/* $Header: det_tbls.c,v 2.3 03/06/04 11:30:16 przybyls Exp $ */

/* det_tbls.c - workfile get/set for detector setpoints */
/* John DeGood; February 1993 */
/* Copyright (c) 1993, Hewlett-Packard Co. */

#include <typedefs.h>
#include <pcb_defs.h>
#include <error.h>
#include <p_wkfile.h>
#include <p_status.h>
#include <wkfile.h>
#include <ramps.h>
#include <zone_config.h>
#include <zone_status.h>
#include <status.h>
#include <zone_ui.h>
#include <method.h>
#include <p_ui.h>
#include <det_ui.h>
#include <detector.h>
#include <clock_ui.h>
#include <meth_config.h>
#include <exception.h>
#include <err_handler.h>
#include <i_op.h>
#include <mio.h>
#include <cmd_set.h>
#include <hostutil.h>
#include <display.h>
#include <messages.h>

extern UI_ERR SetDetHostModel ( POSITION position , BIT8 setpt );
extern BIT8   GetDetHostModel ( POSITION position  );


#define METH_FLOW     METH_INT0

typedef INT32  (* const GET)(void *status, U_INT8 unused_parm);
typedef UI_ERR (* const SET)(void *status, INT32 setpt, U_INT8 unused_parm);

/*********** structs for commands needing multiple pointers ************/

typedef struct
{
        void * const pneu;
        void * const zone;
        POSITION const position;
} MULT_PTRS;

#define pneu_status  ((MULT_PTRS * const)status)->pneu
#define zone_status  ((MULT_PTRS * const)status)->zone
#define position_status ((MULT_PTRS * const)status)->position
#define index_status (int)((MULT_PTRS * const)status)->position

static const MULT_PTRS mpDFXX =
{
        &Inst_Status.Pneu.Frnt_Detector,
        pFRONT_DET_TEMP,
        FRONT
};

static const MULT_PTRS mpDBXX =
{
        &Inst_Status.Pneu.Back_Detector,
        pBACK_DET_TEMP,
        BACK
};

/********************* wrapper function prototypes *********************/

static INT32 mGetTempStatus(void *which, U_INT8 unused);
static INT32 mGetTempSetpt(void *which, U_INT8 unused);
static INT32 mGetTempActual(void *which, U_INT8 unused);
static INT32 mGetDetectorOffset(void *which, U_INT8 unused);

static INT32 mGetDetOnOff(void *which, U_INT8 unused);
static INT32 mGetLDIDOnOff(void *which, U_INT8 unused);
static INT32 mGetDetStatus(void *which, U_INT8 unused);
static INT32 mGetFuelOnOff(void *which, U_INT8 unused);
static INT32 mGetUtilOnOff(void *which, U_INT8 unused);
static INT32 mGetMugOnOff(void *which, U_INT8 unused);
static INT32 mGetFlame(void *which, U_INT8 unused);
static INT32 mGetFIDLitOffset(void *which, U_INT8 unused);

/*

static INT32 mGetOIMCtl1OnOff(void *which, U_INT8 unused);
static INT32 mGetOIMCtl2OnOff(void *which, U_INT8 unused);
static INT32 mGetOIMCtl3OnOff(void *which, U_INT8 unused);
static INT32 mGetOIMCtl4OnOff(void *which, U_INT8 unused);

static INT32 mGetOIMCtl1Value(void *which, U_INT8 unused);
static INT32 mGetOIMCtl2Value(void *which, U_INT8 unused);
static INT32 mGetOIMCtl3Value(void *which, U_INT8 unused);
static INT32 mGetOIMCtl4Value(void *which, U_INT8 unused);

*/

static INT32 mGetOIMCtlOnOff(void *which, U_INT8 channl );
static INT32 mGetOIMCtlValue(void *which, U_INT8 channl );

static INT32 mGetOEMCtlOnOff(void *which, U_INT8 channl );
static INT32 mGetOEMSerialSetpt(void *which, U_INT8 channl );

static INT32 mGetElectrometerType(void *which, U_INT8 unused);

static INT32 mGetFPDLitOffset(void *which, U_INT8 unused);
static INT32 mGetTCDFilament(void *which, U_INT8 unused);
static INT32 mGetTCDNegPolarity(void *which, U_INT8 unused);
static INT32 mGetECDTargetOffset(void *which, U_INT8 unused);
static INT32 mGetNPDBeadTurnOn(void *which, U_INT8 unused);
static INT32 mGetNPDTargetOffset(void *which, U_INT8 unused);
static INT32 mGetDetDAC(void *which, U_INT8 unused);
static INT32 mGetDetEquibTime(void *which, U_INT8 unused);
static INT32 mGetLDIDGlowStatus(void *which, U_INT8 unused);
static INT32 mGetLDIDGlowLevel (void *which, U_INT8 unused);
static INT32 mGetLDIDMinFlow(void *status, U_INT8 unused);

static INT32 mDcGetDetFuelGasMaxFlowRate( void *status, U_INT8 gas_type );
static INT32 mDcGetDetUtilGasMaxFlowRate( void *status, U_INT8 gas_type );
static INT32 mDcGetDetMugGasMaxFlowRate ( void *status, U_INT8 gas_type );


static UI_ERR mSetDetOnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetLDIDOnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetFuelOnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetUtilOnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetMugOnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetFlame(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetFIDLitOffset(void *which, INT32 setpt, U_INT8 unused);

/*

static UI_ERR mSetOIMCtl1OnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetOIMCtl2OnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetOIMCtl3OnOff(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetOIMCtl4OnOff(void *which, INT32 setpt, U_INT8 unused);

static UI_ERR mSetOIMCtl1Value(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetOIMCtl2Value(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetOIMCtl3Value(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetOIMCtl4Value(void *which, INT32 setpt, U_INT8 unused);

*/

static UI_ERR mSetOIMCtlOnOff(void *which, INT32 setpt, U_INT8 channl );
static UI_ERR mSetOIMCtlValue(void *which, INT32 setpt, U_INT8 channl );

static UI_ERR mSetOEMCtlOnOff(void *which, INT32 setpt, U_INT8 channl );
static UI_ERR mSetOEMSerialSetpt(void *which, INT32 setpt, U_INT8 channl );

static UI_ERR mSetElectrometerType(void *which, INT32 setpt, U_INT8 unused);

static UI_ERR mSetFPDLitOffset(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetTCDFilament(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetTCDNegPolarity(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetECDTargetOffset(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetNPDBeadTurnOn(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetNPDTargetOffset(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetDetDAC(void *which, INT32 setpt, U_INT8 unused);
static UI_ERR mSetDetEquibTime(void *which, INT32 setpt, U_INT8 unused);

/* static */ UI_ERR NullFunc(void *which);
static UI_ERR FIDPneuPreFunc(void *which);
static UI_ERR FPDPneuPreFunc(void *which);
static UI_ERR TCDPneuPreFunc(void *which);
static UI_ERR ECDPneuPreFunc(void *which);
static UI_ERR LDIDPneuPreFunc(void *which);
static UI_ERR uECDPneuPreFunc(void *which);
static UI_ERR NPDPneuPreFunc(void *which);
static UI_ERR OEMPneuPreFunc(void *which);
static UI_ERR OIMPreFunc(void *which);
static UI_ERR OEMPreFunc(void *which);
static UI_ERR OEMLockPreFunc(void *which);
static UI_ERR FIDPreFunc(void *which);
static UI_ERR FPDPreFunc(void *which);
static UI_ERR TCDPreFunc(void *which);
static UI_ERR ECDPreFunc(void *which);
static UI_ERR LDIDPreFunc(void *which);
static UI_ERR uECDPreFunc(void *which);
static UI_ERR NPDPreFunc(void *which);
static UI_ERR AIBPreFunc(void *which);
static UI_ERR ElectrometerPreFunc(void *which);
static UI_ERR AlwaysOK  (void *which);
static UI_ERR OkIfEpc   (void *which);
static UI_ERR LockDetPneuWkfile   (void *which);
static UI_ERR UnlockDetPneuWkfile (void *which);

static INT32    mGetDetConstMugMode ( void *status, U_INT8 unused_parm );
static INT32    mGetDetMugOrCombFlow( void *status, U_INT8 unused_parm );
static INT32    mGetFidH2Flow       ( void *status, U_INT8 unused_parm );
static INT32    mGetFidAirFlow      ( void *status, U_INT8 unused_parm );
static INT32    mGetNpdH2Flow       ( void *status, U_INT8 unused_parm );
static INT32    mGetNpdAirFlow      ( void *status, U_INT8 unused_parm );
static INT32    mGetFpdH2Flow       ( void *status, U_INT8 unused_parm );
static INT32    mGetFpdAirFlow      ( void *status, U_INT8 unused_parm );
static INT32    mGetEcdPurgeFlow    ( void *status, U_INT8 unused_parm );
static INT32    mGetTcdRefFlow      ( void *status, U_INT8 unused_parm );
static INT32    mGetOEMGasMode      ( void *status, U_INT8 gas );
static INT32    mGetOEMGasCfg       ( void *status, U_INT8 gas );
static INT32    mGetOEMGasSetpt     ( void *status, U_INT8 gas );

static INT32    mGetDetGasSetpt  ( void *status, U_INT8 gas );
static INT32    mGetDetGasActual ( void *status, U_INT8 gas );

#if 0
static INT32    mGetDetFuelFlowSetpt( void *status, U_INT8 unused_parm );
static INT32    mGetDetUtilFlowSetpt( void *status, U_INT8 unused_parm );
static INT32    mGetDetMugFlowSetpt ( void *status, U_INT8 unused_parm );
static INT32    mGetDetFuelFlowActual(void *status, U_INT8 unused_parm );
static INT32    mGetDetUtilFlowActual(void *status, U_INT8 unused_parm );
static INT32    mGetDetMugFlowActual( void *status, U_INT8 unused_parm );
#endif

static INT32    mGetDetGasCalZero  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetGasCalValu  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetGasCalGain   ( void *status, U_INT8 unused_parm );

static INT32    mGetDetPneuStatus   ( void *status, U_INT8 unused_parm );
static INT32    mGetDetFuelCalZero  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetUtilCalZero  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetMugCalZero   ( void *status, U_INT8 unused_parm );
#if 0
static INT32    mGetDetFuelCalGain  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetUtilCalGain  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetMugCalGain   ( void *status, U_INT8 unused_parm );
#endif
static INT32    mGetDetFuelCalFlow  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetUtilCalFlow  ( void *status, U_INT8 unused_parm );
static INT32    mGetDetMugCalFlow   ( void *status, U_INT8 unused_parm );
static INT32    mGetDetCalDate      ( void *status, U_INT8 unused_parm );
static INT32    mGetDetCalState     ( void *status, U_INT8 unused_parm );

static UI_ERR   mSetDetConstMugMode ( void *status, INT32 state, U_INT8 unused_parm );
static UI_ERR   mSetDetMugOrCombFlow( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetFidH2Flow       ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetFidAirFlow      ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetNpdH2Flow       ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetNpdAirFlow      ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetFpdH2Flow       ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetFpdAirFlow      ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetEcdPurgeFlow    ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetTcdRefFlow      ( void *status, INT32 flow,  U_INT8 unused_parm );
static UI_ERR   mSetOEMGasSetpt     ( void *status, INT32 setpt, U_INT8 gas );
static UI_ERR   mSetDetFuelCalZero  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mSetDetUtilCalZero  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mSetDetMugCalZero   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mSetDetFuelCalFlow  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mSetDetUtilCalFlow  ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mSetDetMugCalFlow   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mSetDetGasType      ( void *status, INT32 setpt, U_INT8 gas );
static UI_ERR   mSetDetCalState     ( void *status, INT32 setpt, U_INT8 gas );
static UI_ERR   mSetDetHostModel    ( void *status, INT32 setpt, U_INT8 unused_parm);

static UI_ERR   mSetDetFactoryCalZero ( void *status, INT32 setpt, U_INT8 unused_parm );

static INT32    mGetDetectorType    ( void *status, U_INT8 unused_parm );
static INT32    mGetZonePresence    ( void *status, U_INT8 unused_parm );
static INT32    mGetIsDetectorEpc   ( void *status, U_INT8 unused_parm );
static INT32    mGetDetPSensorRange ( void *status, U_INT8 gas );
static INT32    mGetDetGasType      ( void *status, U_INT8 gas );
static INT32    mGetDetHostModel   ( void *status, U_INT8 unused_parm );

static UI_ERR   mLetDetectorType    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mLetZonePresence    ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mLetIsDetectorEpc   ( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mLetDetPSensorRange ( void *status, INT32 setpt, U_INT8 gas );
static UI_ERR   mLetDetGasType      ( void *status, INT32 setpt, U_INT8 gas );
static UI_ERR   mChkOEMGasMode      ( void *status, INT32 state, U_INT8 gas );

static INT32    mGetCPFDetTitle   ( void *status, U_INT8 unused_parm );
/*
static INT32    mGetCPFGas1Label  ( void *status, U_INT8 unused_parm );
static INT32    mGetCPFGas2Label  ( void *status, U_INT8 unused_parm );
static INT32    mGetCPFGas3Label  ( void *status, U_INT8 unused_parm );
*/
static INT32    mGetCPFGasLabel   ( void *status, U_INT8 gas         );

/*
static INT32    mGetOIMCtl1Label  ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl1Bits   ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl1Format ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl2Label  ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl2Bits   ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl2Format ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl3Label  ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl3Bits   ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl3Format ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl4Label  ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl4Bits   ( void *status, U_INT8 unused_parm );
static INT32    mGetOIMCtl4Format ( void *status, U_INT8 unused_parm );
*/

static INT32    mGetOIMCtlLabel   ( void *which, U_INT8 channl );
static INT32    mGetOIMCtlBits    ( void *which , U_INT8 channl );
static INT32    mGetOIMCtlFormat  ( void *which, U_INT8 channl );

static INT32    mGetOEMPollTime  ( void *which, U_INT8 unused_parm );
static INT32    mGetOEMDiagParm    ( void *which, U_INT8 indx   );
static INT32    mGetOEMDetLabel      ( void *which, U_INT8 channl ) ;
static INT32    mGetOEMGasLabel      ( void *which, U_INT8 channl ) ;
static INT32    mGetOEMContrlCfg     ( void *which, U_INT8 channl ) ;
static INT32    mGetOEMCtlLabel      ( void *which, U_INT8 channl ) ;
static INT32    mGetOEMPulseLen      ( void *which, U_INT8 channl ) ;
static INT32    mGetOEMInstrLabel    ( void * which, U_INT8 unused_parm );
static INT32    mGetOEMOnOffActual   ( void *which, U_INT8 channl );
static INT32    mGetOEMDiagActual    ( void *which, U_INT8 channl );
static INT32    mGetOEMSerialActual  ( void *which, U_INT8 channl );

static UI_ERR   mLetCPFDetTitlePresence( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mLetCPFDetPneuPresence( void *status, INT32 setpt, U_INT8 unused_parm );
static UI_ERR   mLetCPFOIMPresence( void *status, INT32 setpt, U_INT8 unused_parm );

/*
static UI_ERR   mLetOIMCtl1Bits (void *status, INT32 setpt, U_INT8 unused_parm);
static UI_ERR   mLetOIMCtl2Bits  (void *status, INT32 setpt, U_INT8 unused_parm);
static UI_ERR   mLetOIMCtl3Bits  (void *status, INT32 setpt, U_INT8 unused_parm);
static UI_ERR   mLetOIMCtl4Bits  (void *status, INT32 setpt, U_INT8 unused_parm);
*/
static UI_ERR   mLetOIMCtlBits (void *status, INT32 setpt, U_INT8 channl ) ;

static UI_ERR   mLetOEMContrlCfg ( void *status, INT32 setpt, U_INT8 channl );
static UI_ERR   mLetOEMGasCfg  ( void *status, INT32 setpt, U_INT8 channl );

/********************* command table entries *********************/

static const METHCMD_ENTRY mmDXMF[] =
{
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)N2,    METH_FLOW },
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)H2,    METH_FLOW },
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)He,    METH_FLOW },
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)ArMe,  METH_FLOW },
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)O2,    METH_FLOW },
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)Air,   METH_FLOW },
      { mDcGetDetFuelGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)Argon, METH_FLOW },

      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)N2,    METH_FLOW },
      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)H2,    METH_FLOW },
      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)He,    METH_FLOW },
      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)ArMe,  METH_FLOW },
      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)O2,    METH_FLOW },
      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)Air,   METH_FLOW },
      { mDcGetDetUtilGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)Argon, METH_FLOW },

      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)N2,    METH_FLOW },
      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)H2,    METH_FLOW },
      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)He,    METH_FLOW },
      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)ArMe,  METH_FLOW },
      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)O2,    METH_FLOW },
      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)Air,   METH_FLOW },
      { mDcGetDetMugGasMaxFlowRate,  (SET)NullFunc,   (U_INT8)Argon, METH_FLOW }
};


static const METHCMD_ENTRY mmDXNZ[] =
{
      { mGetFuelOnOff,       mSetFuelOnOff,       1, METH_ON_OFF },
      { mGetUtilOnOff,       mSetUtilOnOff,       2, METH_ON_OFF },
      { mGetMugOnOff,        mSetMugOnOff,        3, METH_ON_OFF }
};


static const METHCMD_ENTRY mmDXNI[] =
{
      { mGetDetConstMugMode, mSetDetConstMugMode, 0, METH_ON_OFF },
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   },
      { mGetFidH2Flow,       mSetFidH2Flow,       4, METH_FLOW   },
      { mGetFidAirFlow,      mSetFidAirFlow,      6, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXNF[] =
{
      { mGetDetConstMugMode, mSetDetConstMugMode, 0, METH_ON_OFF },
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   },
      { mGetFpdH2Flow,       mSetFpdH2Flow,       4, METH_FLOW   },
      { mGetFpdAirFlow,      mSetFpdAirFlow,      6, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXNT[] =
{
      { mGetDetConstMugMode, mSetDetConstMugMode, 0, METH_ON_OFF },
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   },
      { mGetTcdRefFlow,      mSetTcdRefFlow,      6, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXNE[] =
{
      { mGetDetConstMugMode, mSetDetConstMugMode, 0, METH_ON_OFF },
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   },
      { mGetEcdPurgeFlow,    mSetEcdPurgeFlow,    6, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXNU[] =
{
      { mGetDetConstMugMode, mSetDetConstMugMode, 0, METH_ON_OFF },
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXNH[] =
{
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   },
      { mGetLDIDMinFlow,     (SET)NullFunc       ,0, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXNN[] =
{
      { mGetDetConstMugMode, mSetDetConstMugMode, 0, METH_ON_OFF },
      { mGetDetMugOrCombFlow,mSetDetMugOrCombFlow,2, METH_FLOW   },
      { mGetNpdH2Flow,       mSetNpdH2Flow,       4, METH_FLOW   },
      { mGetNpdAirFlow,      mSetNpdAirFlow,      6, METH_FLOW   }
};

static const METHCMD_ENTRY mmDXOP[] =
{
      { mGetOEMGasMode,      mChkOEMGasMode,      1, METH_INT0   },
      { mGetOEMGasSetpt,     mSetOEMGasSetpt,     1, METH_INT0   },    /* METH_INT0 = METH_FLOW = METH_PRES */
      { mGetOEMGasMode,      mChkOEMGasMode,      2, METH_INT0   },
      { mGetOEMGasSetpt,     mSetOEMGasSetpt,     2, METH_INT0   },    /* METH_INT0 = METH_FLOW = METH_PRES */
      { mGetOEMGasMode,      mChkOEMGasMode,      3, METH_INT0   },
      { mGetOEMGasSetpt,     mSetOEMGasSetpt,     3, METH_INT0   }     /* METH_INT0 = METH_FLOW = METH_PRES */
};

static const METHCMD_ENTRY mmDXFI[] =
{
      { mGetDetOnOff,        mSetDetOnOff,        8, METH_ON_OFF },
      { mGetFlame,           mSetFlame,           9, METH_ON_OFF },
      { mGetFIDLitOffset,    mSetFIDLitOffset,   10, METH_INT1 }
};

static const METHCMD_ENTRY mmDXOI[] =
{
      { mGetOIMCtlOnOff,             mSetOIMCtlOnOff,     1, METH_INT0 },
      { mGetOIMCtlValue,             mSetOIMCtlValue,     1, METH_INT0 },
      { mGetOIMCtlOnOff,             mSetOIMCtlOnOff,     2, METH_INT0 },
      { mGetOIMCtlValue,             mSetOIMCtlValue,     2, METH_INT0 },
      { mGetOIMCtlOnOff,             mSetOIMCtlOnOff,     3, METH_INT0 },
      { mGetOIMCtlValue,             mSetOIMCtlValue,     3, METH_INT0 },
      { mGetOIMCtlOnOff,             mSetOIMCtlOnOff,     4, METH_INT0 },
      { mGetOIMCtlValue,             mSetOIMCtlValue,     4, METH_INT0 }
};

static const METHCMD_ENTRY mmDXOE[] =
{
      { mGetDetOnOff,                   mSetDetOnOff,     8, METH_ON_OFF },
      { mGetOEMCtlOnOff,             mSetOEMCtlOnOff,     1, METH_INT0 },
      { mGetOEMCtlOnOff,             mSetOEMCtlOnOff,     2, METH_INT0 },
      { mGetOEMCtlOnOff,             mSetOEMCtlOnOff,     3, METH_INT0 },
      { mGetOEMCtlOnOff,             mSetOEMCtlOnOff,     4, METH_INT0 },
      { mGetOEMCtlOnOff,             mSetOEMCtlOnOff,     5, METH_INT0 },
      { mGetOEMSerialSetpt,       mSetOEMSerialSetpt,     0, METH_INT0 }
};

static const METHCMD_ENTRY mmDXFP[] =
{
      { mGetDetOnOff,        mSetDetOnOff,           8,  METH_ON_OFF },
      { mGetFlame,               mSetFlame,                  9,  METH_ON_OFF },
      { mGetFPDLitOffset,    mSetFPDLitOffset,   10, METH_INT1 }
};

static const METHCMD_ENTRY mmDXTC[] =
{
      { mGetTCDFilament,     mSetTCDFilament,     8, METH_ON_OFF },
      { mGetTCDNegPolarity,  mSetTCDNegPolarity,  9, METH_ON_OFF }
};

static const METHCMD_ENTRY mmDXEC[] =
{
      { mGetDetOnOff,        mSetDetOnOff,        8, METH_ON_OFF },
      { mGetECDTargetOffset, mSetECDTargetOffset, 9, METH_INT0   }
};

static const METHCMD_ENTRY mmDXUE[] =
{
      { mGetDetOnOff,        mSetDetOnOff,        8, METH_ON_OFF }
};

static const METHCMD_ENTRY mmDXHI[] =
{
      { mGetLDIDOnOff,       mSetLDIDOnOff,       8, METH_ON_OFF },
      { mGetLDIDGlowStatus,  (SET)NullFunc,       9, METH_INT0   },
      { mGetLDIDGlowLevel,   (SET)NullFunc,      10, METH_INT2   }
};

static const METHCMD_ENTRY mmDXNP[] =
{
      { mGetDetOnOff,        mSetDetOnOff,        8, METH_ON_OFF },
      { mGetNPDBeadTurnOn,   mSetNPDBeadTurnOn,   9, METH_ON_OFF },
      { mGetNPDTargetOffset, mSetNPDTargetOffset,10, METH_INT0   },
      { mGetDetEquibTime,    mSetDetEquibTime,   11, METH_INT2   }
};

static const METHCMD_ENTRY mmDXAI[] =
{
      { mGetDetOnOff,        mSetDetOnOff,        8, METH_ON_OFF }
};

static const METHCMD_ENTRY mmDXEI[] =
{
      { mGetDetOnOff,        mSetDetOnOff,        8, METH_ON_OFF }
};

static const METHCMD_ENTRY mmDXEL[] =
{
      { mGetElectrometerType,   mSetElectrometerType,   0, METH_INT0}
};


static const METHCMD_ENTRY mmDXOS[] =
{
        { mGetOEMOnOffActual,   (SET)NullFunc, 1, METH_INT0 },
        { mGetOEMOnOffActual,   (SET)NullFunc, 2, METH_INT0 },
        { mGetOEMOnOffActual,   (SET)NullFunc, 3, METH_INT0 },
        { mGetOEMOnOffActual,   (SET)NullFunc, 4, METH_INT0 },
        { mGetOEMOnOffActual,   (SET)NullFunc, 5, METH_INT0 },
        { mGetOEMSerialActual,  (SET)NullFunc, 0, METH_INT0 },
        { mGetOEMDiagActual,    (SET)NullFunc, 1, METH_INT0 },
        { mGetOEMDiagActual,    (SET)NullFunc, 2, METH_INT0 }
};

static const METHCMD_ENTRY mmDXST[] =
{
        { mGetTempStatus,       (SET)NullFunc, 0, METH_INT0 },
        { mGetTempSetpt,        (SET)NullFunc, 0, METH_INT0 },
        { mGetTempActual,       (SET)NullFunc, 0, METH_INT0 },
        { mGetDetPneuStatus,    (SET)NullFunc, 0, METH_INT0 },
        { mGetDetGasSetpt,      (SET)NullFunc, 1, METH_FLOW },
        { mGetDetGasActual,     (SET)NullFunc, 1, METH_FLOW },
        { mGetDetGasSetpt,      (SET)NullFunc, 2, METH_FLOW },
        { mGetDetGasActual,     (SET)NullFunc, 2, METH_FLOW },
        { mGetDetGasSetpt,      (SET)NullFunc, 3, METH_FLOW },
        { mGetDetGasActual,     (SET)NullFunc, 3, METH_FLOW },
        { mGetDetStatus,        (SET)NullFunc, 0, METH_INT0},
        { mGetDetectorOffset,   (SET)NullFunc, 0, METH_INT1 }
};

static const METHCMD_ENTRY mmDXHM[] =
{
        {mGetDetHostModel,  mSetDetHostModel,   1,      METH_INT0}
};

static const METHCMD_ENTRY mmDXCE[] =
{
        {mGetDetGasType,        mSetDetGasType,         1,      METH_INT0}   /*       ONLY  OEM_gas1 */
};

static const METHCMD_ENTRY mmDXCF[] =
{
        {mGetDetGasType,        mSetDetGasType,         3,      METH_INT0},  /* makeup   OR OEM_gas3 */
        {mGetDetGasType,        mSetDetGasType,         2,      METH_INT0}   /* oxidizer OR OEM_gas2 */
};

static const METHCMD_ENTRY mmDXTW[] =
{
        {mGetCPFDetTitle,     mLetCPFDetTitlePresence,  0,      METH_CSTR}
};

static const METHCMD_ENTRY mmDXGW[] =
{
    {mGetCPFGasLabel,   mLetCPFDetPneuPresence, 1,  METH_CSTR},
        {mGetCPFGasLabel,       (SET)NullFunc,          2,      METH_CSTR},
        {mGetCPFGasLabel,       (SET)NullFunc,              3,  METH_CSTR}
};

static const METHCMD_ENTRY mmDXOW[] =
{
    {mGetOIMCtlLabel,   mLetCPFOIMPresence, 1,  METH_CSTR},
    {mGetOIMCtlBits,        mLetOIMCtlBits,         1,      METH_INT0},
    {mGetOIMCtlFormat,      (SET)NullFunc,          1,      METH_INT0},
    {mGetOIMCtlLabel,   (SET)NullFunc,              2,      METH_CSTR},
    {mGetOIMCtlBits,        mLetOIMCtlBits,         2,      METH_INT0},
    {mGetOIMCtlFormat,      (SET)NullFunc,          2,      METH_INT0},
    {mGetOIMCtlLabel,   (SET)NullFunc,              3,      METH_CSTR},
    {mGetOIMCtlBits,        mLetOIMCtlBits,         3,      METH_INT0},
    {mGetOIMCtlFormat,      (SET)NullFunc,          3,      METH_INT0},
    {mGetOIMCtlLabel,   (SET)NullFunc,              4,      METH_CSTR},
    {mGetOIMCtlBits,        mLetOIMCtlBits,         4,      METH_INT0},
    {mGetOIMCtlFormat,      (SET)NullFunc,          4,      METH_INT0}
};

const BIT8  OEM_DET_MODE_CFG_CNT  =  3 ;   /* defines # of OEM DET gases to be "gccw" cfg chkd;  see (a) below */
const BIT8  OEM_DET_LABEL_CFG_CNT = 10 ;   /* defines # of OEM DET labels to be "gccw" cfg chkd; see (b) below */

static const METHCMD_ENTRY mmDXCO[] =
{
                                                              /* Membership info for OEM_DET_xxx_CFG_CNT <---.    */
                                                              /*                                             |    */
                                                              /*                                             |    */
                                                              /*                                             |    */
                                                              /*                          Status err msgs:   |    */
                                                              /*                          "F Det err: XXX"   |    */
                                                              /*                          "B Det err: XXX"   |    */
                                                              /*       Setpoint to be       where XXX hex    |    */
                                                              /*        config checked     is listed below   v    */
                                                              /*       -----------------  ----------------  ---   */
    {mGetOEMGasCfg ,        mLetOEMGasCfg ,     1,  METH_INT0},        /* Gas1 mode       00001             (a)   */
                                                                       /* calls ResetOEMCtlStates first !!        */
    {mGetOEMGasCfg ,        mLetOEMGasCfg ,     2,  METH_INT0},        /* Gas2 mode       00002             (a)   */
    {mGetOEMGasCfg ,        mLetOEMGasCfg ,     3,  METH_INT0},        /* Gas3 mode       00004             (a)   */

                                                                       /* Ctl_1 presence  00008             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   1,  METH_INT0},        /* Ctl_1 pulse               02000         */
                                                                       /* Ctl_2 presence  00010             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   2,  METH_INT0},        /* Ctl_2 pulse               04000         */
                                                                       /* Ctl_3 presence  00020             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   3,  METH_INT0},        /* Ctl_3 pulse               08000         */
                                                                       /* Ctl_4 presence  00040             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   4,  METH_INT0},        /* Ctl_4 pulse               10000         */
                                                                       /* Ctl_5 presence  00080             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   5,  METH_INT0},        /* Ctl_5 pulse               20000         */

    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   6,  METH_INT0},        /* Actual presence 00100             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   7,  METH_INT0},        /* Setpt  presence 00200             (b)   */

    /* ... MCtlLabel,       mLetOEMCtlState,    8,  METH_INT0), */     /* Ctl_8 NOT USED  00400             (b)   */

    {mGetOEMContrlCfg,      mLetOEMContrlCfg,   9,  METH_INT0},        /* diag1 label     00800             (b)   */
    {mGetOEMContrlCfg,      mLetOEMContrlCfg,  10,  METH_INT0}         /* diag2 label     01000             (b)   */
};


static const METHCMD_ENTRY mmDXOC[] =
{
    {mGetOEMInstrLabel,     (SET)NullFunc,      0,  METH_CSTR},
    {mGetOEMDetLabel,       (SET)NullFunc,      0,  METH_CSTR},

    {mGetOEMGasLabel,       (SET)NullFunc,      1,  METH_CSTR},
    {mGetOEMGasCfg ,        (SET)NullFunc,      1,  METH_INT0},
    {mGetOEMGasLabel,       (SET)NullFunc,      2,  METH_CSTR},
    {mGetOEMGasCfg ,        (SET)NullFunc,      2,  METH_INT0},
    {mGetOEMGasLabel,       (SET)NullFunc,      3,  METH_CSTR},
    {mGetOEMGasCfg ,        (SET)NullFunc,      3,  METH_INT0},

    {mGetOEMCtlLabel,       (SET)NullFunc,      1,  METH_CSTR},
    {mGetOEMPulseLen,       (SET)NullFunc,      1,  METH_INT0},
    {mGetOEMCtlLabel,       (SET)NullFunc,      2,  METH_CSTR},
    {mGetOEMPulseLen,       (SET)NullFunc,      2,  METH_INT0},
    {mGetOEMCtlLabel,       (SET)NullFunc,      3,  METH_CSTR},
    {mGetOEMPulseLen,       (SET)NullFunc,      3,  METH_INT0},
    {mGetOEMCtlLabel,       (SET)NullFunc,      4,  METH_CSTR},
    {mGetOEMPulseLen,       (SET)NullFunc,      4,  METH_INT0},
    {mGetOEMCtlLabel,       (SET)NullFunc,      5,  METH_CSTR},
    {mGetOEMPulseLen,       (SET)NullFunc,      5,  METH_INT0},

    {mGetOEMCtlLabel,       (SET)NullFunc,      6,  METH_CSTR},
    {mGetOEMCtlLabel,       (SET)NullFunc,      7,  METH_CSTR},

    /* ... MCtlLabel,       (SET)NullFunc,      8,  METH_CSTR),    */

    {mGetOEMCtlLabel,       (SET)NullFunc,      9,  METH_CSTR},
    {mGetOEMDiagParm,       (SET)NullFunc,      0,  METH_INT0},
    {mGetOEMDiagParm,       (SET)NullFunc,      1,  METH_INT0},
    {mGetOEMDiagParm,       (SET)NullFunc,      3,  METH_INT0},
    {mGetOEMDiagParm,       (SET)NullFunc,      2,  METH_INT0},

    {mGetOEMCtlLabel,       (SET)NullFunc,     10,  METH_CSTR},
    {mGetOEMDiagParm,       (SET)NullFunc,      4,  METH_INT0},
    {mGetOEMDiagParm,       (SET)NullFunc,      5,  METH_INT0},
    {mGetOEMDiagParm,       (SET)NullFunc,      7,  METH_INT0},
    {mGetOEMDiagParm,       (SET)NullFunc,      6,  METH_INT0},

    {mGetOEMPollTime,       (SET)NullFunc,      0,  METH_INT0}
};


static const METHCMD_ENTRY mmDXCW[] =
{
        {mGetDetectorType,      mLetDetectorType,       0,      METH_INT0},
        {mGetZonePresence,      mLetZonePresence,       0,      METH_INT0},
        {mGetIsDetectorEpc,     mLetIsDetectorEpc,      0,      METH_INT0},
        {mGetDetPSensorRange,   mLetDetPSensorRange,    1,      METH_INT0},  /* fuel     */
        {mGetDetPSensorRange,   mLetDetPSensorRange,    2,      METH_INT0},  /* oxidizer */
        {mGetDetPSensorRange,   mLetDetPSensorRange,    3,      METH_INT0},  /* makeup   */
        {mGetDetGasType,        mLetDetGasType,         2,      METH_INT0},  /* oxidizer */
        {mGetDetGasType,        mLetDetGasType,         3,      METH_INT0}   /* makeup   */
};

static const METHCMD_ENTRY mmDXDA[] =
{
        { mGetDetDAC, mSetDetDAC, 0, METH_INT0 }
};

static const METHCMD_ENTRY mmDXLF[] =
{
        { mGetDetFuelCalFlow, mSetDetFuelCalFlow, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXLU[] =
{
        { mGetDetUtilCalFlow, mSetDetUtilCalFlow, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXLM[] =
{
        { mGetDetMugCalFlow, mSetDetMugCalFlow, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXZF[] =
{
        { mGetDetFuelCalZero, mSetDetFuelCalZero, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXZU[] =
{
        { mGetDetUtilCalZero, mSetDetUtilCalZero, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXZM[] =
{
        { mGetDetMugCalZero, mSetDetMugCalZero, 0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXFZ[] =
{
        { mGetDetFuelCalZero, mSetDetFactoryCalZero, 0, METH_FLOW },
        { mGetDetUtilCalZero, (SET)NullFunc,         0, METH_FLOW },
        { mGetDetMugCalZero,  (SET)NullFunc,         0, METH_FLOW }
};

static const METHCMD_ENTRY mmDXLS[] =
{
        { mGetDetCalState,    (SET)NullFunc, 0, METH_INT0 },
        { mGetDetCalDate,     (SET)NullFunc, 0, METH_INT0 },
        { mGetDetGasCalZero,  (SET)NullFunc, 1, METH_FLOW },
        { mGetDetGasCalZero,  (SET)NullFunc, 2, METH_FLOW },
        { mGetDetGasCalZero,  (SET)NullFunc, 3, METH_FLOW },
        { mGetDetGasCalValu,  (SET)NullFunc, 1, METH_FLOW },
        { mGetDetGasCalValu,  (SET)NullFunc, 2, METH_FLOW },
        { mGetDetGasCalValu,  (SET)NullFunc, 3, METH_FLOW },
        { mGetDetGasCalGain,  (SET)NullFunc, 1, METH_INT2 },
        { mGetDetGasCalGain,  (SET)NullFunc, 2, METH_INT2 },
        { mGetDetGasCalGain,  (SET)NullFunc, 3, METH_INT2 }
};

static const METHCMD_ENTRY mmDXLX[] =
{
        { mGetDetCalState,    mSetDetCalState, 0, METH_INT0 }
};

/********************* command tables *********************/

const METHCMD mDFMF =
{
        MAXINDEX(mmDXMF, METHCMD_ENTRY),
        &mmDXMF[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBMF =
{
        MAXINDEX(mmDXMF, METHCMD_ENTRY),
        &mmDXMF[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFNZ =
{
        MAXINDEX(mmDXNZ, METHCMD_ENTRY),
        &mmDXNZ[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBNZ =
{
        MAXINDEX(mmDXNZ, METHCMD_ENTRY),
        &mmDXNZ[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFNI =
{
        MAXINDEX(mmDXNI, METHCMD_ENTRY),
        &mmDXNI[0],
        (MULT_PTRS * const) &mpDFXX,
        FIDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNI =
{
        MAXINDEX(mmDXNI, METHCMD_ENTRY),
        &mmDXNI[0],
        (MULT_PTRS * const) &mpDBXX,
        FIDPneuPreFunc,
        UnlockDetPneuWkfile
};


const METHCMD mDFNF =
{
        MAXINDEX(mmDXNF, METHCMD_ENTRY),
        &mmDXNF[0],
        (MULT_PTRS * const) &mpDFXX,
        FPDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNF =
{
        MAXINDEX(mmDXNF, METHCMD_ENTRY),
        &mmDXNF[0],
        (MULT_PTRS * const) &mpDBXX,
        FPDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFNT =
{
        MAXINDEX(mmDXNT, METHCMD_ENTRY),
        &mmDXNT[0],
        (MULT_PTRS * const) &mpDFXX,
        TCDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNT =
{
        MAXINDEX(mmDXNT, METHCMD_ENTRY),
        &mmDXNT[0],
        (MULT_PTRS * const) &mpDBXX,
        TCDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFNE =
{
        MAXINDEX(mmDXNE, METHCMD_ENTRY),
        &mmDXNE[0],
        (MULT_PTRS * const) &mpDFXX,
        ECDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNE =
{
        MAXINDEX(mmDXNE, METHCMD_ENTRY),
        &mmDXNE[0],
        (MULT_PTRS * const) &mpDBXX,
        ECDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFNU =
{
        MAXINDEX(mmDXNU, METHCMD_ENTRY),
        &mmDXNU[0],
        (MULT_PTRS * const) &mpDFXX,
        uECDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNU =
{
        MAXINDEX(mmDXNU, METHCMD_ENTRY),
        &mmDXNU[0],
        (MULT_PTRS * const) &mpDBXX,
        uECDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFNH =
{
        MAXINDEX(mmDXNH, METHCMD_ENTRY),
        &mmDXNH[0],
        (MULT_PTRS * const) &mpDFXX,
        LDIDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNH =
{
        MAXINDEX(mmDXNH, METHCMD_ENTRY),
        &mmDXNH[0],
        (MULT_PTRS * const) &mpDBXX,
        LDIDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFNN =
{
        MAXINDEX(mmDXNN, METHCMD_ENTRY),
        &mmDXNN[0],
        (MULT_PTRS * const) &mpDFXX,
        NPDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBNN =
{
        MAXINDEX(mmDXNN, METHCMD_ENTRY),
        &mmDXNN[0],
        (MULT_PTRS * const) &mpDBXX,
        NPDPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFOP =
{
        MAXINDEX(mmDXOP, METHCMD_ENTRY),
        &mmDXOP[0],
        (MULT_PTRS * const) &mpDFXX,
        OEMPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBOP =
{
        MAXINDEX(mmDXOP, METHCMD_ENTRY),
        &mmDXOP[0],
        (MULT_PTRS * const) &mpDBXX,
        OEMPneuPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFFI =
{
        MAXINDEX(mmDXFI, METHCMD_ENTRY),
        &mmDXFI[0],
        (MULT_PTRS * const) &mpDFXX,
        FIDPreFunc,
        NullFunc
};

const METHCMD mDBFI =
{
        MAXINDEX(mmDXFI, METHCMD_ENTRY),
        &mmDXFI[0],
        (MULT_PTRS * const) &mpDBXX,
        FIDPreFunc,
        NullFunc
};

const METHCMD mDFOI =
{
        MAXINDEX(mmDXOI, METHCMD_ENTRY),
        &mmDXOI[0],
        (MULT_PTRS * const) &mpDFXX,
        OIMPreFunc,
        NullFunc
};

const METHCMD mDBOI =
{
        MAXINDEX(mmDXOI, METHCMD_ENTRY),
        &mmDXOI[0],
        (MULT_PTRS * const) &mpDBXX,
        OIMPreFunc,
        NullFunc
};

const METHCMD mDFOE =
{
        MAXINDEX(mmDXOE, METHCMD_ENTRY),
        &mmDXOE[0],
        (MULT_PTRS * const) &mpDFXX,
        OEMPreFunc,
        NullFunc
};

const METHCMD mDBOE =
{
        MAXINDEX(mmDXOE, METHCMD_ENTRY),
        &mmDXOE[0],
        (MULT_PTRS * const) &mpDBXX,
        OEMPreFunc,
        NullFunc
};

const METHCMD mDFFP =
{
        MAXINDEX(mmDXFP, METHCMD_ENTRY),
        &mmDXFP[0],
        (MULT_PTRS * const) &mpDFXX,
        FPDPreFunc,
        NullFunc
};

const METHCMD mDBFP =
{
        MAXINDEX(mmDXFP, METHCMD_ENTRY),
        &mmDXFP[0],
        (MULT_PTRS * const) &mpDBXX,
        FPDPreFunc,
        NullFunc
};

const METHCMD mDFTC =
{
        MAXINDEX(mmDXTC, METHCMD_ENTRY),
        &mmDXTC[0],
        (MULT_PTRS * const) &mpDFXX,
        TCDPreFunc,
        NullFunc
};

const METHCMD mDBTC =
{
        MAXINDEX(mmDXTC, METHCMD_ENTRY),
        &mmDXTC[0],
        (MULT_PTRS * const) &mpDBXX,
        TCDPreFunc,
        NullFunc
};

const METHCMD mDFEC =
{
        MAXINDEX(mmDXEC, METHCMD_ENTRY),
        &mmDXEC[0],
        (MULT_PTRS * const) &mpDFXX,
        ECDPreFunc,
        NullFunc
};

const METHCMD mDBEC =
{
        MAXINDEX(mmDXEC, METHCMD_ENTRY),
        &mmDXEC[0],
        (MULT_PTRS * const) &mpDBXX,
        ECDPreFunc,
        NullFunc
};

const METHCMD mDFUE =
{
        MAXINDEX(mmDXUE, METHCMD_ENTRY),
        &mmDXUE[0],
        (MULT_PTRS * const) &mpDFXX,
        uECDPreFunc,
        NullFunc
};

const METHCMD mDBUE =
{
        MAXINDEX(mmDXUE, METHCMD_ENTRY),
        &mmDXUE[0],
        (MULT_PTRS * const) &mpDBXX,
        uECDPreFunc,
        NullFunc
};

const METHCMD mDFHI =
{
        MAXINDEX(mmDXHI, METHCMD_ENTRY),
        &mmDXHI[0],
        (MULT_PTRS * const) &mpDFXX,
        LDIDPreFunc,
        NullFunc
};

const METHCMD mDBHI =
{
        MAXINDEX(mmDXHI, METHCMD_ENTRY),
        &mmDXHI[0],
        (MULT_PTRS * const) &mpDBXX,
        LDIDPreFunc,
        NullFunc
};

const METHCMD mDFNP =
{
        MAXINDEX(mmDXNP, METHCMD_ENTRY),
        &mmDXNP[0],
        (MULT_PTRS * const) &mpDFXX,
        NPDPreFunc,
        NullFunc
};

const METHCMD mDBNP =
{
        MAXINDEX(mmDXNP, METHCMD_ENTRY),
        &mmDXNP[0],
        (MULT_PTRS * const) &mpDBXX,
        NPDPreFunc,
        NullFunc
};

const METHCMD mDFAI =
{
        MAXINDEX(mmDXAI, METHCMD_ENTRY),
        &mmDXAI[0],
        (MULT_PTRS * const) &mpDFXX,
        AIBPreFunc,
        NullFunc
};

const METHCMD mDBAI =
{
        MAXINDEX(mmDXAI, METHCMD_ENTRY),
        &mmDXAI[0],
        (MULT_PTRS * const) &mpDBXX,
        AIBPreFunc,
        NullFunc
};

const METHCMD mDFEI =
{
        MAXINDEX(mmDXEI, METHCMD_ENTRY),
        &mmDXEI[0],
        (MULT_PTRS * const) &mpDFXX,
        ElectrometerPreFunc,
        NullFunc
};

const METHCMD mDBEI =
{
        MAXINDEX(mmDXEI, METHCMD_ENTRY),
        &mmDXEI[0],
        (MULT_PTRS * const) &mpDBXX,
        ElectrometerPreFunc,
        NullFunc
};

const METHCMD mDFEL =
{
        MAXINDEX(mmDXEL, METHCMD_ENTRY),
        &mmDXEL[0],
        (MULT_PTRS * const) &mpDFXX,
        NullFunc,
        NullFunc
};

const METHCMD mDBEL =
{
        MAXINDEX(mmDXEL, METHCMD_ENTRY),
        &mmDXEL[0],
        (MULT_PTRS * const) &mpDBXX,
        NullFunc,
        NullFunc
};

const METHCMD mDFOS =
{
        MAXINDEX(mmDXOS, METHCMD_ENTRY),
        &mmDXOS[0],
        (MULT_PTRS * const) &mpDFXX,
        AlwaysOK,
        NullFunc
};

const METHCMD mDBOS =
{
        MAXINDEX(mmDXOS, METHCMD_ENTRY),
        &mmDXOS[0],
        (MULT_PTRS * const) &mpDBXX,
        AlwaysOK,
        NullFunc
};

const METHCMD mDFST =
{
        MAXINDEX(mmDXST, METHCMD_ENTRY),
        &mmDXST[0],
        (MULT_PTRS * const) &mpDFXX,
        AlwaysOK,
        NullFunc
};

const METHCMD mDBST =
{
        MAXINDEX(mmDXST, METHCMD_ENTRY),
        &mmDXST[0],
        (MULT_PTRS * const) &mpDBXX,
        AlwaysOK,
        NullFunc
};

const METHCMD mDFHM =
{
        MAXINDEX(mmDXHM, METHCMD_ENTRY),
        &mmDXHM[0],
        (MULT_PTRS * const) &mpDFXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBHM =
{
        MAXINDEX(mmDXHM, METHCMD_ENTRY),
        &mmDXHM[0],
        (MULT_PTRS * const) &mpDBXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFCE =
{
        MAXINDEX(mmDXCE, METHCMD_ENTRY),
        &mmDXCE[0],
        (MULT_PTRS * const) &mpDFXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBCE =
{
        MAXINDEX(mmDXCE, METHCMD_ENTRY),
        &mmDXCE[0],
        (MULT_PTRS * const) &mpDBXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFCF =
{
        MAXINDEX(mmDXCF, METHCMD_ENTRY),
        &mmDXCF[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBCF =
{
        MAXINDEX(mmDXCF, METHCMD_ENTRY),
        &mmDXCF[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};


const METHCMD mDFGW =
{
        MAXINDEX(mmDXGW, METHCMD_ENTRY),
        &mmDXGW[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBGW =
{
        MAXINDEX(mmDXGW, METHCMD_ENTRY),
        &mmDXGW[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};
const METHCMD mDFTW =
{
        MAXINDEX(mmDXTW, METHCMD_ENTRY),
        &mmDXTW[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBTW =
{
        MAXINDEX(mmDXTW, METHCMD_ENTRY),
        &mmDXTW[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};
const METHCMD mDFOW =
{
        MAXINDEX(mmDXOW, METHCMD_ENTRY),
        &mmDXOW[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBOW =
{
        MAXINDEX(mmDXOW, METHCMD_ENTRY),
        &mmDXOW[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFCO =
{
        MAXINDEX(mmDXCO, METHCMD_ENTRY),
        &mmDXCO[0],
        (MULT_PTRS * const) &mpDFXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBCO =
{
        MAXINDEX(mmDXCO, METHCMD_ENTRY),
        &mmDXCO[0],
        (MULT_PTRS * const) &mpDBXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFOC =
{
        MAXINDEX(mmDXOC, METHCMD_ENTRY),
        &mmDXOC[0],
        (MULT_PTRS * const) &mpDFXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDBOC =
{
        MAXINDEX(mmDXOC, METHCMD_ENTRY),
        &mmDXOC[0],
        (MULT_PTRS * const) &mpDBXX,
        OEMLockPreFunc,
        UnlockDetPneuWkfile
};

const METHCMD mDFCW =
{
        MAXINDEX(mmDXCW, METHCMD_ENTRY),
        &mmDXCW[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBCW =
{
        MAXINDEX(mmDXCW, METHCMD_ENTRY),
        &mmDXCW[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFDA =
{
        MAXINDEX(mmDXDA, METHCMD_ENTRY),
        &mmDXDA[0],
        (MULT_PTRS * const) &mpDFXX,
        AlwaysOK,
        NullFunc
};

const METHCMD mDBDA =
{
        MAXINDEX(mmDXDA, METHCMD_ENTRY),
        &mmDXDA[0],
        (MULT_PTRS * const) &mpDBXX,
        AlwaysOK,
        NullFunc
};

const METHCMD mDFLF =
{
        MAXINDEX(mmDXLF, METHCMD_ENTRY),
        &mmDXLF[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBLF =
{
        MAXINDEX(mmDXLF, METHCMD_ENTRY),
        &mmDXLF[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFZF =
{
        MAXINDEX(mmDXZF, METHCMD_ENTRY),
        &mmDXZF[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBZF =
{
        MAXINDEX(mmDXZF, METHCMD_ENTRY),
        &mmDXZF[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};



const METHCMD mDFFZ =
{
        MAXINDEX(mmDXFZ, METHCMD_ENTRY),
        &mmDXFZ[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBFZ =
{
        MAXINDEX(mmDXFZ, METHCMD_ENTRY),
        &mmDXFZ[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};




const METHCMD mDFLU =
{
        MAXINDEX(mmDXLU, METHCMD_ENTRY),
        &mmDXLU[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBLU =
{
        MAXINDEX(mmDXLU, METHCMD_ENTRY),
        &mmDXLU[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFZU =
{
        MAXINDEX(mmDXZU, METHCMD_ENTRY),
        &mmDXZU[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBZU =
{
        MAXINDEX(mmDXZU, METHCMD_ENTRY),
        &mmDXZU[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};




const METHCMD mDFLM =
{
        MAXINDEX(mmDXLM, METHCMD_ENTRY),
        &mmDXLM[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBLM =
{
        MAXINDEX(mmDXLM, METHCMD_ENTRY),
        &mmDXLM[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDFZM =
{
        MAXINDEX(mmDXZM, METHCMD_ENTRY),
        &mmDXZM[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBZM =
{
        MAXINDEX(mmDXZM, METHCMD_ENTRY),
        &mmDXZM[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};



const METHCMD mDFLS =
{
        MAXINDEX(mmDXLS, METHCMD_ENTRY),
        &mmDXLS[0],
        (MULT_PTRS * const) &mpDFXX,
        OkIfEpc,
        NullFunc
};

const METHCMD mDBLS =
{
        MAXINDEX(mmDXLS, METHCMD_ENTRY),
        &mmDXLS[0],
        (MULT_PTRS * const) &mpDBXX,
        OkIfEpc,
        NullFunc
};


const METHCMD mDFLX =
{
        MAXINDEX(mmDXLX, METHCMD_ENTRY),
        &mmDXLX[0],
        (MULT_PTRS * const) &mpDFXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

const METHCMD mDBLX =
{
        MAXINDEX(mmDXLX, METHCMD_ENTRY),
        &mmDXLX[0],
        (MULT_PTRS * const) &mpDBXX,
        LockDetPneuWkfile,
        UnlockDetPneuWkfile
};

/********************* "get" wrapper functions *********************/

static INT32 mDcGetDetFuelGasMaxFlowRate( void *status, U_INT8 gas_type )
{
        return DcGetDetFuelGasMaxFlowRate( pneu_status, (GAS_TYPE)gas_type );
}

static INT32 mDcGetDetUtilGasMaxFlowRate( void *status, U_INT8 gas_type )
{
        return DcGetDetUtilGasMaxFlowRate( pneu_status, (GAS_TYPE)gas_type );
}

static INT32 mDcGetDetMugGasMaxFlowRate( void *status, U_INT8 gas_type )
{
        return DcGetDetMugGasMaxFlowRate( pneu_status, (GAS_TYPE)gas_type );
}

static INT32 mGetTempStatus(void *which, U_INT8 unused)
{
        (void) unused;

        return (INT32) GetTempStatus(((MULT_PTRS * const)which)->zone);
}

static INT32 mGetTempSetpt(void *which, U_INT8 unused)
{
        (void)unused;

        return GetTempSetpt(((MULT_PTRS * const)which)->zone);
}

static INT32 mGetTempActual(void *which, U_INT8 unused)
{
        (void)unused;

        return GetTempActual(((MULT_PTRS * const)which)->zone);
}

static INT32 mGetDetOnOff(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetDetOnOff(((MULT_PTRS * const)which)->position);
}

static INT32 mGetLDIDOnOff(void *which, U_INT8 unused)
{
        (void)unused;
mLog("call mGetLDIDOnOff\n");
return 0;
        //return (INT32)GetLDIDOnOff(((MULT_PTRS * const)which)->position);
}

static INT32 mGetElectrometerType(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetElectrometerType(((MULT_PTRS * const)which)->position);
}

static INT32 mGetDetStatus(void *which, U_INT8 unused)
{
  ON_OFF status;
        (void)unused;

        switch ( GetDetectorType(((MULT_PTRS * const)which)->position) )
        {
        case ECD:
                status = ECDStatus(((MULT_PTRS * const)which)->position);
                break;

        case FID:
        case FPD:
                status = FlameStatus(((MULT_PTRS * const)which)->position);
                break;

        case NPD:
                status = NPDStatus(((MULT_PTRS * const)which)->position);
                break;

        case TCD:
                status = TCDStatus(((MULT_PTRS * const)which)->position);
                break;

        case uECD:
        default:  /* AIB  */
                status = GetDetOnOff(((MULT_PTRS * const)which)->position);
        }
       
        return (INT32)status;
}

static INT32 mGetDetectorOffset(void *which, U_INT8 unused)
{
        (void)unused;

        return GetDetectorOffset(((MULT_PTRS * const)which)->position);
}

static INT32 mGetFlame(void *which, U_INT8 unused)
{
        (void)unused;

        mLog("call mGetFlame\n");
        return 0;
        //return (INT32)GetFlame(((MULT_PTRS * const)which)->position);
}

static INT32 mGetFIDLitOffset(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetFIDLitOffset\n");
  return 0;

        //return GetFIDLitOffset(((MULT_PTRS * const)which)->position);
}

static INT32 mGetOIMCtlOnOff(void *which, U_INT8 channl )
{
  mLog("call mGetOIMCtlOnOff\n");
  return 0;
        //return (INT32)GetCPFCtlOnOff(((MULT_PTRS * const)which)->position, channl );
}

static INT32 mGetOIMCtlValue(void *which, U_INT8 channl )
{
  mLog("call mGetOIMCtlValue\n");
  return 0;
      //  return (INT32)GetCPFCtlValue(((MULT_PTRS * const)which)->position, channl );
}

static INT32 mGetOEMCtlOnOff(void *which, U_INT8 channl )
{
  mLog("call mGetOEMCtlOnOff\n");
  return 0;
        //return    (INT32)GetOEMCtlOnOff(((MULT_PTRS * const)which)->position, channl ); /* rtns wkfile values */
}


static INT32 mGetOEMSerialSetpt(void *which, U_INT8 unused )
{
        (void)unused;
        return Active_Wkfile.det_cpf_ctl[ ((MULT_PTRS * const)which)->position ].value ;
}


#if 0
{

static INT32 mGetOIMCtl1OnOff(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetCPFCtlOnOff(((MULT_PTRS * const)which)->position,1);
}
static INT32 mGetOIMCtl2OnOff(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetCPFCtlOnOff(((MULT_PTRS * const)which)->position,2);
}
static INT32 mGetOIMCtl3OnOff(void *which, U_INT8 unused)
{
        (void)unused;
        return (INT32)GetCPFCtlOnOff(((MULT_PTRS * const)which)->position,3);
}
static INT32 mGetOIMCtl4OnOff(void *which, U_INT8 unused)
{
        (void)unused;
        return (INT32)GetCPFCtlOnOff(((MULT_PTRS * const)which)->position,4);
}

static INT32 mGetOIMCtl1Value(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetCPFCtlValue(((MULT_PTRS * const)which)->position,1);
}
static INT32 mGetOIMCtl2Value(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetCPFCtlValue(((MULT_PTRS * const)which)->position,2);
}
static INT32 mGetOIMCtl3Value(void *which, U_INT8 unused)
{
        (void)unused;
        return (INT32)GetCPFCtlValue(((MULT_PTRS * const)which)->position,3);
}
static INT32 mGetOIMCtl4Value(void *which, U_INT8 unused)
{
        (void)unused;
        return (INT32)GetCPFCtlValue(((MULT_PTRS * const)which)->position,4);
}

}
#endif

static INT32 mGetFPDLitOffset(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetFPDLitOffset\n");
  return 0;

        //return GetFPDLitOffset(((MULT_PTRS * const)which)->position);
}

static INT32 mGetTCDFilament(void *which, U_INT8 unused)
{
        (void)unused;

        return (INT32)GetTCDFilament(((MULT_PTRS * const)which)->position);
}

static INT32 mGetTCDNegPolarity(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetTCDNegPolarity\n");
  return 0;

       // return (INT32)GetTCDNegPolarity(((MULT_PTRS * const)which)->position);
}

static INT32 mGetECDTargetOffset(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetECDTargetOffset\n");
  return 0;

        //return GetECDTargetOffset(((MULT_PTRS * const)which)->position);
}

static INT32 mGetNPDBeadTurnOn(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetNPDBeadTurnOn\n");
  return 0;

        //return (INT32)GetNPDBeadTurnOn(((MULT_PTRS * const)which)->position);
}

static INT32 mGetNPDTargetOffset(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetNPDTargetOffset\n");
  return 0;

        //return GetNPDTargetOffset(((MULT_PTRS * const)which)->position);
}

static INT32 mGetDetDAC(void *which, U_INT8 unused)
{
  INT32 retval;
  mLog("call mGetDetDAC\n");
  return 0;
  /*

        (void)unused;

        switch (GetDetectorType(((MULT_PTRS * const)which)->position))
        {
        case ECD:
                retval = GetECDRefCurrent(((MULT_PTRS * const)which)->position);
                break;

        case NPD:
                retval = GetNPDBeadVoltage(((MULT_PTRS * const)which)->position);
                break;

        default:
                retval = 0;
        }
        return retval;
        */
}

static INT32 mGetDetEquibTime(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetDetEquibTime\n");
  return 0;

        //return GetDetEquibTime(((MULT_PTRS * const)which)->position);
}

static INT32 mGetLDIDGlowStatus(void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetLDIDGlowStatus\n");
  return 0;

        //return GetLDIDGlowStatus(((MULT_PTRS * const)which)->position);
}

static INT32 mGetLDIDGlowLevel (void *which, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetLDIDGlowLevel\n");
  return 0;

        //return GetLDIDGlowLevel(((MULT_PTRS * const)which)->position);
}

static INT32 mGetLDIDMinFlow(void *status, U_INT8 unused)
{
  (void)unused;
  mLog("call mGetLDIDGlowLevel\n");
  return 0;

        return DcGetLDIDMinFlow (pneu_status);
}

/********************* "set" wrapper functions *********************/

static UI_ERR mSetDetOnOff(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;
   mLog("call mSetDetOnOff\n");
   return 0;
   //return SetDetSetptOnOff(((MULT_PTRS * const)which)->position, (ON_OFF)setpt);
}

static UI_ERR mSetLDIDOnOff(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;

   mLog("call mSetLDIDOnOff\n");
   return 0;
   //return SetLDIDSetptOnOff(((MULT_PTRS * const)which)->position, (ON_OFF)setpt);
}

static UI_ERR mSetElectrometerType(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;

   mLog("call mSetElectrometerType\n");
   return 0;
   //return SetElectrometerType(((MULT_PTRS * const)which)->position, (BIT8)setpt);
}

static UI_ERR mSetFlame(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;

		mLog("call mSetFlame\n");
		return 0;
        //return DCSetFlame(((MULT_PTRS * const)which)->position, (ON_OFF)setpt);
}

static UI_ERR mSetFIDLitOffset(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;

		mLog("call mSetFIDLitOffset\n");
		return 0;
        //return SetFIDLitOffset(((MULT_PTRS * const)which)->position, setpt);
}

static UI_ERR mSetOIMCtlOnOff(void *which, INT32 setpt, U_INT8 channl )
{
	mLog("call mSetOIMCtlOnOff\n");
	return 0;
  // return SetCPFCtlOnOff(((MULT_PTRS * const)which)->position,channl,(ON_OFF)setpt);
}

static UI_ERR mSetOIMCtlValue(void *which, INT32 setpt, U_INT8 channl )
{
	mLog("call mSetOIMCtlValue\n");
	return 0;
       // return SetCPFCtlValue(((MULT_PTRS * const)which)->position,channl ,setpt);
}

static UI_ERR mSetOEMCtlOnOff(void *which, INT32 setpt, U_INT8 channl )
{
	mLog("call mSetOEMCtlOnOff\n");
	return 0;
  // return SetOEMCtlOnOff(((MULT_PTRS * const)which)->position,channl,(ON_OFF)setpt);
}

static UI_ERR mSetOEMSerialSetpt (void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetOEMSerialSetpt\n");
	return 0;
   // return SetOEMXtrlValue (((MULT_PTRS * const)which)->position, setpt);
}

#if 0
{

static UI_ERR mSetOIMCtl1OnOff(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;
   return SetCPFCtlOnOff(((MULT_PTRS * const)which)->position,1,(ON_OFF)setpt);
}

static UI_ERR mSetOIMCtl2OnOff(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;
   return SetCPFCtlOnOff(((MULT_PTRS * const)which)->position,2,(ON_OFF)setpt);
}

static UI_ERR mSetOIMCtl3OnOff(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;
   return SetCPFCtlOnOff(((MULT_PTRS * const)which)->position,3,(ON_OFF)setpt);
}

static UI_ERR mSetOIMCtl4OnOff(void *which, INT32 setpt, U_INT8 unused)
{
   (void)unused;
   return SetCPFCtlOnOff(((MULT_PTRS * const)which)->position,4,(ON_OFF)setpt);
}

static UI_ERR mSetOIMCtl1Value(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;
        return SetCPFCtlValue(((MULT_PTRS * const)which)->position,1 ,setpt);
}

static UI_ERR mSetOIMCtl2Value(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;
        return SetCPFCtlValue(((MULT_PTRS * const)which)->position,2, setpt);
}

static UI_ERR mSetOIMCtl3Value(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;
        return SetCPFCtlValue(((MULT_PTRS * const)which)->position,3 ,setpt);
}

static UI_ERR mSetOIMCtl4Value(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;
        return SetCPFCtlValue(((MULT_PTRS * const)which)->position,4 ,setpt);
}

}
#endif

static UI_ERR mSetFPDLitOffset(void *which, INT32 setpt, U_INT8 unused)
{
        (void)unused;
		mLog("call mSetFPDLitOffset\n");
		return 0;

        //return SetFPDLitOffset(((MULT_PTRS * const)which)->position, setpt);
}

static UI_ERR mSetTCDFilament(void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetTCDFilament\n");
	return 0;

       // return DCSetTCDFilament(((MULT_PTRS * const)which)->position, (ON_OFF)setpt);
}

static UI_ERR mSetTCDNegPolarity(void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetTCDNegPolarity\n");
	return 0;

        //return SetTCDNegPolarity(((MULT_PTRS * const)which)->position, (ON_OFF)setpt);
}

static UI_ERR mSetECDTargetOffset(void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetECDTargetOffset\n");
	return 0;

        //return SetECDTargetOffset(((MULT_PTRS * const)which)->position, setpt);
}

static UI_ERR mSetNPDBeadTurnOn(void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetNPDBeadTurnOn\n");
	return 0;

        //return DCSetNPDBeadTurnOn(((MULT_PTRS * const)which)->position, (ON_OFF)setpt);
}

static UI_ERR mSetNPDTargetOffset(void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetNPDTargetOffset\n");
	return 0;

        //return SetNPDTargetOffset(((MULT_PTRS * const)which)->position, setpt);
}

static UI_ERR mSetDetDAC(void *which, INT32 setpt, U_INT8 unused)
{
        UI_ERR retval;

		(void)unused;
		mLog("call mSetDetDAC\n");
		return 0;
		/*

        switch (GetDetectorType(((MULT_PTRS * const)which)->position))
        {
        case ECD:
                retval = SetECDRefCurrent(((MULT_PTRS * const)which)->position, setpt);
                break;

        case NPD:
                retval = SetNPDBeadVoltage(((MULT_PTRS * const)which)->position, setpt);
                break;

        default:
                retval = NOT_COMPATIBLE;
        }
        return retval;
		*/
}

static UI_ERR mSetDetEquibTime(void *which, INT32 setpt, U_INT8 unused)
{
	(void)unused;
	mLog("call mSetDetEquibTime\n");
	return 0;

       // return SetDetEquibTime(((MULT_PTRS * const)which)->position, setpt);
}

/******************* "pre" and "post" functions ********************/

#if 0
static UI_ERR NullFunc(void *which)
{
        (void) which;
        return OK;
}
#endif

static UI_ERR LockDetPneuWkfile ( void *which )
{
   (void) which;
   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

static UI_ERR UnlockDetPneuWkfile ( void *which )
{
   (void) which;
   ReleaseResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

static UI_ERR FIDPneuPreFunc(void *which)
{
EEPROM_DET_TYPE det_type;
     det_type = GetDetType( ( (((MULT_PTRS * const)which)->position)==FRONT ) ?
                                 pFRONT_DETECTOR : pBACK_DETECTOR );

     /* check if pneumatics type is other than EPF or Manual FID */
     if( !( (det_type == MAN_FID) || (det_type == EPC_FID) ) )
     {
             return NOT_INSTALLED;
     }


     if ( DoingMethodInstall() )
     {
          if ( ((MULT_PTRS * const)which)->position == FRONT )
          {
               if ( TestForException ( FRNT_DET_EPC        ) ||
                    TestForException ( FRNT_DET_FUEL_RANGE ) ||
                    TestForException ( FRNT_DET_UTIL_RANGE ) ||
                    TestForException ( FRNT_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
          else
          {
               if ( TestForException ( BACK_DET_EPC        ) ||
                    TestForException ( BACK_DET_FUEL_RANGE ) ||
                    TestForException ( BACK_DET_UTIL_RANGE ) ||
                    TestForException ( BACK_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
     }

     LockResource ( &Inst_Status.Pneu.Resource_Lock );
     return OK;

}
static UI_ERR FPDPneuPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != FPD)
        {
                return NOT_INSTALLED;
        }

     if ( DoingMethodInstall() )
     {
          if ( ((MULT_PTRS * const)which)->position == FRONT )
          {
               if ( TestForException ( FRNT_DET_EPC        ) ||
                    TestForException ( FRNT_DET_FUEL_RANGE ) ||
                    TestForException ( FRNT_DET_UTIL_RANGE ) ||
                    TestForException ( FRNT_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
          else
          {
               if ( TestForException ( BACK_DET_EPC        ) ||
                    TestForException ( BACK_DET_FUEL_RANGE ) ||
                    TestForException ( BACK_DET_UTIL_RANGE ) ||
                    TestForException ( BACK_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
     }

     LockResource ( &Inst_Status.Pneu.Resource_Lock );
     return OK;

}

static UI_ERR TCDPneuPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != TCD)
        {
                return NOT_INSTALLED;
        }

     if ( DoingMethodInstall() )
     {
          if ( ((MULT_PTRS * const)which)->position == FRONT )
          {
               if ( TestForException ( FRNT_DET_EPC        ) ||
                    TestForException ( FRNT_DET_UTIL_RANGE ) ||
                    TestForException ( FRNT_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
          else
          {
               if ( TestForException ( BACK_DET_EPC        ) ||
                    TestForException ( BACK_DET_UTIL_RANGE ) ||
                    TestForException ( BACK_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
     }

     LockResource ( &Inst_Status.Pneu.Resource_Lock );
     return OK;

}

static UI_ERR ECDPneuPreFunc(void *which)
{
   DET_TYPE det_type;

   det_type = GetDetectorType(((MULT_PTRS * const)which)->position);

   if (det_type != ECD)
   {
      return NOT_INSTALLED;
   }

   if ( DoingMethodInstall() )
   {
      if ( ((MULT_PTRS * const)which)->position == FRONT )
      {
         if ( TestForException ( FRNT_DET_EPC        ) ||
              TestForException ( FRNT_DET_UTIL_RANGE ) ||
              TestForException ( FRNT_DET_MUG_RANGE  ))
         {
            return NOT_ALLOWED;
         }
      }
      else
      {
         if ( TestForException ( BACK_DET_EPC        ) ||
              TestForException ( BACK_DET_UTIL_RANGE ) ||
              TestForException ( BACK_DET_MUG_RANGE  ))
         {
            return NOT_ALLOWED;
         }
      }
   }

   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

static UI_ERR uECDPneuPreFunc(void *which)
{
   DET_TYPE det_type;

   det_type = GetDetectorType(((MULT_PTRS * const)which)->position);

   if ( det_type != uECD )
   {
      return NOT_INSTALLED;
   }

   if ( DoingMethodInstall() )
   {
      if ( ((MULT_PTRS * const)which)->position == FRONT )
      {
         if ( TestForException ( FRNT_DET_EPC        ) ||
              TestForException ( FRNT_DET_MUG_RANGE  ))
         {
            return NOT_ALLOWED;
         }
      }
      else
      {
         if ( TestForException ( BACK_DET_EPC        ) ||
              TestForException ( BACK_DET_MUG_RANGE  ))
         {
            return NOT_ALLOWED;
         }
      }
   }

   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

static UI_ERR LDIDPneuPreFunc(void *which)
{
   DET_TYPE det_type;

   det_type = GetDetectorType(((MULT_PTRS * const)which)->position);

   if ( det_type != LDID )
   {
      return NOT_INSTALLED;
   }

   if ( DoingMethodInstall() )
   {
      if ( ((MULT_PTRS * const)which)->position == FRONT )
      {
         if ( TestForException ( FRNT_DET_EPC        ) ||
              TestForException ( FRNT_DET_MUG_RANGE  ))
         {
            return NOT_ALLOWED;
         }
      }
      else
      {
         if ( TestForException ( BACK_DET_EPC        ) ||
              TestForException ( BACK_DET_MUG_RANGE  ))
         {
            return NOT_ALLOWED;
         }
      }
   }

   LockResource ( &Inst_Status.Pneu.Resource_Lock );
   return OK;
}

static UI_ERR NPDPneuPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != NPD)
        {
                return NOT_INSTALLED;
        }

     if ( DoingMethodInstall() )
     {
          if ( ((MULT_PTRS * const)which)->position == FRONT )
          {
               if ( TestForException ( FRNT_DET_EPC        ) ||
                    TestForException ( FRNT_DET_FUEL_RANGE ) ||
                    TestForException ( FRNT_DET_UTIL_RANGE ) ||
                    TestForException ( FRNT_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
          else
          {
               if ( TestForException ( BACK_DET_EPC        ) ||
                    TestForException ( BACK_DET_FUEL_RANGE ) ||
                    TestForException ( BACK_DET_UTIL_RANGE ) ||
                    TestForException ( BACK_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
     }

     LockResource ( &Inst_Status.Pneu.Resource_Lock );
     return OK;

}

static UI_ERR OEMPneuPreFunc(void *which)
{
     if ( GetDetType( ( (((MULT_PTRS * const)which)->position)==FRONT ) ?
                             pFRONT_DETECTOR : pBACK_DETECTOR ) != EPC_OEM ) return NOT_INSTALLED;

     if ( DoingMethodInstall() )
     {
          if ( ((MULT_PTRS * const)which)->position == FRONT )
          {
               if ( TestForException ( FRNT_DET_EPC        ) ||
                    TestForException ( FRNT_DET_FUEL_RANGE ) ||
                    TestForException ( FRNT_DET_UTIL_RANGE ) ||
                    TestForException ( FRNT_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
          else
          {
               if ( TestForException ( BACK_DET_EPC        ) ||
                    TestForException ( BACK_DET_FUEL_RANGE ) ||
                    TestForException ( BACK_DET_UTIL_RANGE ) ||
                    TestForException ( BACK_DET_MUG_RANGE  ))
               {
                    return NOT_ALLOWED;
               }
          }
     }

     LockResource ( &Inst_Status.Pneu.Resource_Lock );
     return OK;

}

static UI_ERR OEMPreFunc(void *which)
{
        switch ( GetDetectorType(((MULT_PTRS * const)which)->position))
        {
        case OEM_FID:
        case OEM_AIB:
            return OK;
        default:
            return NOT_INSTALLED;
        }
}

static UI_ERR OEMLockPreFunc(void *which)
{
        switch ( GetDetectorType(((MULT_PTRS * const)which)->position))
        {
        case OEM_FID:
        case OEM_AIB:
            LockResource ( &Inst_Status.Pneu.Resource_Lock );
            return OK;
        default:
            return NOT_INSTALLED;
        }
}
static UI_ERR FIDPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != FID)
        {
                return NOT_INSTALLED;
        }

     return OK;

}

static UI_ERR OIMPreFunc(void *which)
{
     if ( GetCPFOIMPresence( ((MULT_PTRS * const)which)->position ) )
     {
        return OK;
     }
     else
     {
        return NOT_INSTALLED;
     }
}

static UI_ERR FPDPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != FPD)
        {
                return NOT_INSTALLED;
        }

     return OK;

}

static UI_ERR TCDPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != TCD)
        {
                return NOT_INSTALLED;
        }

     return OK;

}

static UI_ERR ECDPreFunc(void *which)
{
   DET_TYPE det_type;

   det_type = GetDetectorType(((MULT_PTRS * const)which)->position);

   if ( det_type != ECD )
   {
      return NOT_INSTALLED;
   }

   return OK;
}

static UI_ERR uECDPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != uECD)
        {
                return NOT_INSTALLED;
        }

     return OK;

}

static UI_ERR LDIDPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != LDID)
        {
                return NOT_INSTALLED;
        }

     return OK;

}

static UI_ERR NPDPreFunc(void *which)
{
        if (GetDetectorType(((MULT_PTRS * const)which)->position) != NPD)
        {
                return NOT_INSTALLED;
        }

     return OK;

}

static UI_ERR AIBPreFunc(void *which)
{
    switch (GetDetectorType(((MULT_PTRS * const)which)->position) )
    {
       case AIB : return OK ;

       case OEM_AIB:
       case OEM_FID:
            if(
               (
                 (((MULT_PTRS * const)which)->position == FRONT) ?
                           DetectorA_Config.host_model:
                           DetectorB_Config.host_model             ) == TYPE_13_14_AS_AIB
              ) return OK ;

            return NOT_INSTALLED;   /* for Flexelint */

       default:  return NOT_INSTALLED ;

    }
}

static UI_ERR ElectrometerPreFunc(void *which)
{
   if (GetElectrometerType(((MULT_PTRS * const)which)->position) )
   {
      return OK;
   }

   return NOT_INSTALLED;
}

static UI_ERR AlwaysOK (void *which)
{
    (void)which;
    return OK;
}

static UI_ERR OkIfEpc (void *which)
{
    (void)which;
    return EpcDetector( ((MULT_PTRS * const)which)->pneu ) ? OK : NOT_INSTALLED;
}

static INT32   mGetDetConstMugMode ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     if ( GetDetConstMkupMode ( pneu_status ) == ON )  return 1;
     else                                              return 0;
}

static UI_ERR   mSetDetConstMugMode ( void *status, INT32 state, U_INT8 unused_parm )
{
     (void) unused_parm;
     return SetDetConstMkupMode ( (ON_OFF) state, pneu_status );
}


static INT32    mGetDetMugOrCombFlow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     if ( GetDetConstMkupMode ( pneu_status ) == ON )
         return DcGetConstMakeupFlowSetpt( pneu_status );
     else
         return DcGetDetectorGasFlowSetpt( pneu_status, 3 );
}

static UI_ERR   mSetDetMugOrCombFlow ( void *status, INT32 flow, U_INT8 unused_parm )
{
     (void) unused_parm;
     if ( GetDetConstMkupMode ( pneu_status ) == ON )
         return DcSetConstMakeupFlowSetpt ( flow, pneu_status );
     else
         return DcSetDetectorGasFlowSetpt ( flow, pneu_status, 3 );
}

static INT32    mGetFuelOnOff ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return (INT32) GetDetGasWkfileState( pneu_status, 1 );
}

static UI_ERR   DcSetDetGasState ( ON_OFF state, void *status, U_INT8 chnl )
{
   switch ( GetDetectorType(position_status) )
   {
      case OEM_AIB:
      case OEM_FID:
         if (TYPE_13_14_AS_AIB == ( (position_status== FRONT ) ? DetectorA_Config.host_model:
                                                                 DetectorB_Config.host_model  )) return OK ;
   }

   return SetDetGasState ( (ON_OFF) state, pneu_status, chnl );
}

static UI_ERR   mSetFuelOnOff ( void *status, INT32 state, U_INT8 unused_parm    )
{
   (void) unused_parm;

   /* if CPF and gas is not present, can't turn gas on */
   if( (GetCPFDetPneuPresence(position_status)) &&
       (!GetCPFDetGasPresence(position_status, 1)) &&
       ((ON_OFF) state == ON) )
   {
      return NOT_INSTALLED;
   }

   return DcSetDetGasState ( (ON_OFF) state, status, 1 );
}


static INT32    mGetUtilOnOff ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return (INT32) GetDetGasWkfileState( pneu_status, 2 );
}

static UI_ERR   mSetUtilOnOff ( void *status, INT32 state, U_INT8 unused_parm    )
{
   (void) unused_parm;

   /* if CPF and gas is not present, can't turn gas on */
   if( (GetCPFDetPneuPresence(position_status)) &&
       (!GetCPFDetGasPresence(position_status, 2)) &&
       ((ON_OFF) state == ON) )
   {
      return NOT_INSTALLED;
   }

   return DcSetDetGasState ( (ON_OFF) state, status, 2 );
}


static INT32    mGetMugOnOff ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return (INT32) GetDetGasWkfileState( pneu_status, 3 );
}

static UI_ERR   mSetMugOnOff ( void *status, INT32 state, U_INT8 unused_parm     )
{
   (void) unused_parm;

   /* if CPF and gas is not present, can't turn gas on */
   if( (GetCPFDetPneuPresence(position_status)) &&
       (!GetCPFDetGasPresence(position_status, 3)) &&
       ((ON_OFF) state == ON) )
   {
      return NOT_INSTALLED;
   }

   return DcSetDetGasState ( (ON_OFF) state, status, 3 );
}

/***************************************************************************/
/***************************************************************************/

static INT32    mGetFidH2Flow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetGasWkfileFlowSetpt( pneu_status, FID_FUEL_GAS );
}

static UI_ERR   mSetFidH2Flow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, FID_FUEL_GAS );
}


static INT32    mGetFidAirFlow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetGasWkfileFlowSetpt( pneu_status, FID_AIR_GAS );
}

static UI_ERR   mSetFidAirFlow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, FID_AIR_GAS );
}

/***************************************************************************/
/***************************************************************************/

static INT32    mGetNpdH2Flow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetectorGasFlowSetpt( pneu_status, NPD_FUEL_GAS );
}

static UI_ERR   mSetNpdH2Flow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, NPD_FUEL_GAS );
}


static INT32    mGetNpdAirFlow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetectorGasFlowSetpt( pneu_status, NPD_AIR_GAS );
}

static UI_ERR   mSetNpdAirFlow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, NPD_AIR_GAS );
}


/***************************************************************************/
/***************************************************************************/

static INT32    mGetFpdH2Flow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetGasWkfileFlowSetpt( pneu_status, FPD_FUEL_GAS );
}

static UI_ERR   mSetFpdH2Flow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, FPD_FUEL_GAS );
}


static INT32    mGetFpdAirFlow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetGasWkfileFlowSetpt( pneu_status, FPD_AIR_GAS );
}

static UI_ERR   mSetFpdAirFlow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, FPD_AIR_GAS );
}

/***************************************************************************/
/***************************************************************************/

static INT32    mGetEcdPurgeFlow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetectorGasFlowSetpt( pneu_status, ECD_ANODE_PURGE_GAS );
}

static UI_ERR   mSetEcdPurgeFlow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, ECD_ANODE_PURGE_GAS );
}


/***************************************************************************/
/***************************************************************************/

static INT32    mGetTcdRefFlow ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
    return DcGetDetectorGasFlowSetpt( pneu_status, TCD_REF_GAS );
}

static UI_ERR   mSetTcdRefFlow ( void *status, INT32 flow, U_INT8 unused_parm  )
{
     (void) unused_parm;
     return DcSetDetectorGasFlowSetpt ( flow, pneu_status, TCD_REF_GAS );
}


/***************************************************************************/
/***************************************************************************/


static INT32    mGetOEMGasMode   ( void *status, U_INT8 gas )
{
    return (INT32) GetOEMGasStatus(pneu_status,gas ) ;
}

static INT32    mGetOEMGasCfg    ( void *status, U_INT8 gas )
{
    return (INT32) OEMDetFritFlags[index_status][gas-1];
}

static UI_ERR   mChkOEMGasMode   ( void *status, INT32 state, U_INT8 gas )
{
    if (state  == (INT32)GetOEMGasStatus( pneu_status, gas )) return OK ;
    return PARAM_ABORTED ;
}

static INT32    mGetOEMGasSetpt   ( void *status, U_INT8 gas )
{
        switch ( GetOEMGasStatus(pneu_status,gas ) )
        {
        default:
        case NOT_USED: /* case 0 */
                return 0 ;

        case PRES:    /* case 1 */
                return DcGetDetectorGasPresSetpt( pneu_status, gas );

        case FLOW:    /* case 2 */
                return DcGetDetectorGasFlowSetpt(pneu_status , gas) ;
        }
}

static UI_ERR   mSetOEMGasSetpt   ( void *status, INT32 setpt, U_INT8 gas )
{

        switch ( GetOEMGasStatus(pneu_status,gas ) )
        {
        default:
        case NOT_USED:
                return ( 0 == setpt) ? OK : NOT_COMPATIBLE ;

        case PRES:
        return DcSetDetPresSetpt ( setpt, pneu_status, gas  );

        case FLOW:
        return DcSetDetectorGasFlowSetpt ( setpt, pneu_status, gas  );
        }

}

/***************************************************************************/
/***************************************************************************/

static INT32    mGetDetGasSetpt ( void *status, U_INT8 gas )
{
     if ( PRES == GetDetGasStatus( pneu_status, gas ) )
     {
          return DcGetDetectorGasPresSetpt( pneu_status, gas );
     }
     else
     {
          return DcGetDetectorGasFlowSetpt ( pneu_status, gas );
     }
}

static INT32    mGetDetGasActual( void *status, U_INT8 gas )
{
     if ( PRES == GetDetGasStatus( pneu_status, gas ) )
     {
          return DcGetDetectorPresActual( pneu_status, gas );
     }
     else
     {
          return DcGetDetectorGasFlowActual ( pneu_status, gas );
     }
}

#if 0
{
static INT32    mGetDetFuelFlowSetpt( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetectorGasFlowSetpt ( pneu_status, 1 );
}

static INT32    mGetDetUtilFlowSetpt( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetectorGasFlowSetpt ( pneu_status, 2 );
}

static INT32    mGetDetMugFlowSetpt ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetectorGasFlowSetpt ( pneu_status, 3 );
}

static INT32    mGetDetFuelFlowActual(void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetectorGasFlowActual ( pneu_status, 1 );
}

static INT32    mGetDetUtilFlowActual(void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetectorGasFlowActual ( pneu_status, 2 );
}

static INT32    mGetDetMugFlowActual( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetectorGasFlowActual ( pneu_status, 3 );
}
}
#endif


static INT32    mGetDetPneuStatus   ( void *status, U_INT8 unused_parm )
{
     INT32  result;

     (void) unused_parm;

     result = 0;

     result |= ( (INT32) GetDetGasState( pneu_status, 1 ) & 3);
     result |= (((INT32) GetDetGasState( pneu_status, 2 ) & 3) << 2);
     result |= (((INT32) GetDetGasState( pneu_status, 3 ) & 3) << 4);
     result |= (((INT32) (PRES == GetDetGasStatus( pneu_status, 1 )))  << 8);
     result |= (((INT32) (PRES == GetDetGasStatus( pneu_status, 2 )))  << 9);
     result |= (((INT32) (PRES == GetDetGasStatus( pneu_status, 3 )))  << 10);

     return result;
}

#if 0
static INT32    mGetDetFuelCalGain  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlowGain ( pneu_status, 1 );
}
#endif

#if 0
static INT32    mGetDetUtilCalGain  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlowGain ( pneu_status, 2 );
}
#endif

#if 0
static INT32    mGetDetMugCalGain   ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlowGain ( pneu_status, 3 );
}
#endif

static INT32    mGetDetGasCalGain   ( void *status, U_INT8 gas )
{
     if (PRES == GetDetGasStatus( pneu_status, gas )) return DcGetDetCalPresGain ( pneu_status, gas );
     return DcGetDetCalFlowGain ( pneu_status, gas );
}

static INT32    mGetDetGasCalValu  ( void *status, U_INT8 gas )
{
     if (PRES == GetDetGasStatus( pneu_status, gas )) return DcGetDetCalPresValue ( pneu_status, gas );
     return DcGetDetCalFlow ( pneu_status, gas );
}

static INT32    mGetDetGasCalZero  ( void *status, U_INT8 gas )
{
     if (PRES == GetDetGasStatus( pneu_status, gas )) return DcGetDetCalPresZero ( pneu_status, gas );
     return DcGetDetCalFlowZero ( pneu_status, gas );
}

static INT32    mGetDetFuelCalZero  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlowZero ( pneu_status, 1 );
}

static INT32    mGetDetUtilCalZero  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlowZero ( pneu_status, 2 );
}

static INT32    mGetDetMugCalZero   ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlowZero ( pneu_status, 3 );
}

static INT32    mGetDetFuelCalFlow  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlow ( pneu_status, 1 );
}

static INT32    mGetDetUtilCalFlow  ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlow ( pneu_status, 2 );
}

static INT32    mGetDetMugCalFlow   ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcGetDetCalFlow ( pneu_status, 3 );
}

static INT32    mGetDetCalDate      ( void *status, U_INT8 unused_parm )
{
     (void) unused_parm;

     return (INT32)SecondsSince1980 (GetDetCalibDate ( pneu_status ) );
}


static INT32    mGetDetCalState    ( void *status, U_INT8 unused_parm )
{
     INT32  result;

     (void) unused_parm;

     result = (INT32)DetUserCalibState( pneu_status );
     result |= (((INT32) (PRES == GetDetGasStatus( pneu_status, 1 )))  << 3);
     result |= (((INT32) (PRES == GetDetGasStatus( pneu_status, 2 )))  << 4);
     result |= (((INT32) (PRES == GetDetGasStatus( pneu_status, 3 )))  << 5);

     return result;
}

static UI_ERR   mSetDetCalState     ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;

        switch ( setpt )
        {
            case FACTORY:       return DcDeleteDetCalib ( pneu_status );
            case USER_ENABLED:  return DcTurnOnDetCalib ( pneu_status );
            case USER_DISABLED: return DcTurnOffDetCalib ( pneu_status );
        }

        return INVALID_PARAM;
}



static UI_ERR   mSetDetFactoryCalZero  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return DcSetDetFactoryCalFlowZero ( pneu_status );
}

static UI_ERR   mSetDetFuelCalZero  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return DcSetDetCalFlowZero ( pneu_status, 1 );
}

static UI_ERR   mSetDetUtilCalZero  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return DcSetDetCalFlowZero ( pneu_status, 2 );
}

static UI_ERR   mSetDetMugCalZero   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;
     return DcSetDetCalFlowZero ( pneu_status, 3 );
}

static UI_ERR   mSetDetFuelCalFlow  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcSetDetCalFlow ( pneu_status, 1, setpt );
}

static UI_ERR   mSetDetUtilCalFlow  ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcSetDetCalFlow ( pneu_status, 2, setpt );
}

static UI_ERR   mSetDetMugCalFlow   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     return DcSetDetCalFlow ( pneu_status, 3, setpt );
}

static UI_ERR   mSetDetHostModel ( void *status, INT32 setpt, U_INT8 unused_parm)
{
     (void) unused_parm;
	 mLog("call mSetDetHostModel\n");
	 return 0;
     //return SetDetHostModel( position_status, (BIT8)setpt );
}

static UI_ERR   mSetDetGasType   ( void *status, INT32 setpt, U_INT8 gas)
{
	return SetDetectorGasType( pneu_status, gas, (GAS_TYPE)setpt );
}

static INT32    mGetDetectorType    ( void *status, U_INT8 unused_parm )
{
#define ELECT  ( GetDetectorType(position_status) )
#define PNEU   ( GetDetType((position_status==FRONT) ? pFRONT_DETECTOR : pBACK_DETECTOR) )
#define OIM    ( GetCPFOIMPresence(position_status) )
#define CPF    ( GetCPFDetPneuPresence(position_status) )

    DET_TYPE card_type;
    INT32    det_type;
    BIT8     electrometer;
    BIT8     hostmodel;

    (void) unused_parm;

    electrometer = GetElectrometerType(position_status);

    /* if CPF pneumatics or OIM board is present use new style detector type */
    if( GetCPFDetPneuPresence(position_status) || /* OIM flow module */
            GetCPFOIMPresence(position_status) || /* OIM control module */
                                  electrometer || /* OIM electrometer */
        (((ELECT==NO_DET)||(ELECT==AIB))&&((DET_TYPE)((BIT8)PNEU & 0x0F)==FID)) )
                                    /* FID flow module not programmed into OIM yet */
    {
       det_type  = (INT32)((BIT8)ELECT & 0x3F);
       /* if FID electrometer change detector type */
       if( electrometer )
       {
          det_type |=  0x10;
       }
       det_type |= ( (INT32)((BIT8)PNEU & 0x2F) << 6 );/* NOTE: 2F clears EPC bit */
       det_type |= ( (INT32)(OIM & 0x07) << 12 );
       det_type |= ( (INT32)(CPF & 0x01) << 15 );
       return det_type;
    }
    else
    {
        card_type = GetDetectorType(position_status);
        switch ( card_type )
        {
           case OEM_AIB:
           case OEM_FID:
              hostmodel = (position_status==FRONT) ? DetectorA_Config.host_model:
                                                     DetectorB_Config.host_model  ;
              if (hostmodel == TYPE_13_14_AS_AIB ) return (INT32)AIB ;
              if (hostmodel == TYPE_13_14_AS_NODET ) return (INT32)NO_DET ;
              return (INT32)card_type;

           default:
              return (INT32)card_type;
        }
    }

}

static INT32    mGetZonePresence    ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

        return (INT32)GetTempZonePresence(zone_status);
}

static INT32    mGetIsDetectorEpc   ( void *status, U_INT8 unused_parm )
{
    (void) unused_parm;

    return (INT32)DCIsDetectorEpc(position_status);
}

static INT32    mGetDetPSensorRange ( void *status, U_INT8 gas )
{
    return GetDetPSensorRange(pneu_status, gas);
}

static INT32    mGetDetHostModel   ( void *status, U_INT8 unused_parm )
{
        (void) unused_parm;

		mLog("call mGetDetHostModel\n");
		return 0;
        //return (INT32)GetDetHostModel(position_status );
}

static INT32    mGetDetGasType      ( void *status, U_INT8 gas )
{
    return (INT32)GetDetectorGasType(pneu_status, gas);
}

static UI_ERR   mLetDetectorType    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

        gccw.DetectorType[index_status] = (DET_TYPE)setpt;
        return OK;
}

static UI_ERR   mLetZonePresence    ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

        gccw.ZonePresence[(position_status == FRONT) ? (int)DETA_ZONE : (int)DETB_ZONE] = (BIT8)setpt;
        return OK;
}

static UI_ERR   mLetIsDetectorEpc   ( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

        gccw.IsDetectorEpc[index_status] = (TRUE_FALSE)setpt;
        return OK;
}

static UI_ERR   mLetDetPSensorRange ( void *status, INT32 setpt, U_INT8 gas )
{
        switch (gas)
        {
        case 1:
                gccw.DetFuelSensorRange[index_status] = setpt;
                break;
        case 2:
                gccw.DetUtilSensorRange[index_status] = setpt;
                break;
        case 3:
                gccw.DetMugSensorRange[index_status] = setpt;
                break;
        }
        return OK;
}

static UI_ERR   mLetDetGasType      ( void *status, INT32 setpt, U_INT8 num )
{
        switch (num)
        {
        case 2:
                gccw.DetUtilGasType[index_status] = (GAS_TYPE)setpt;
                break;
        case 3:
                gccw.DetMugGasType[index_status] = (GAS_TYPE)setpt;
                break;
        }
        return OK;
}
/***************************************************************************/
/***************************************************************************/
static INT32    mGetCPFDetTitle ( void * which, U_INT8 unused_parm )
{
    DET_TYPE type;
    BIT8  *msg_string;
    (void) unused_parm;

    type = GetDetectorType(((MULT_PTRS * const)which)->position);

    if(GetCPFDetTitlePresence( ((MULT_PTRS * const)which)->position ))
    {
          return (INT32) GetCPFDetTitle ( ((MULT_PTRS * const)which)->position );
    }

    if ( (type!=OEM_AIB) &&(type != OEM_FID) )           return (INT32)"";

    msg_string =  GetCPFDetTitle ( ((MULT_PTRS * const)which)->position ); /* GetCPFDetTitle rtns FDName or BDName */
    if (*msg_string > 1 ) return (INT32) msg_string ;

    return (INT32)(2+MessageToString( type==OEM_AIB? MSG_DET_OEM_AIB: MSG_DET_OEM_FID ));

}
#if 0
{

static INT32    mGetCPFGas1Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFDetGasPresence( ((MULT_PTRS * const)which)->position, 1))
     {
        return (INT32)GetCPFGasLabel ( ((MULT_PTRS * const)which)->position , 1);
     }
     else
     {
        return (INT32)"";
     }
}
static INT32    mGetCPFGas2Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;


     if(GetCPFDetGasPresence( ((MULT_PTRS * const)which)->position, 2))
     {
        return (INT32)GetCPFGasLabel ( ((MULT_PTRS * const)which)->position , 2);
     }
     else
     {
        return (INT32)"";
     }
}
static INT32    mGetCPFGas3Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFDetGasPresence( ((MULT_PTRS * const)which)->position, 3))
     {
        return (INT32)GetCPFGasLabel ( ((MULT_PTRS * const)which)->position , 3);
     }
     else
     {
        return (INT32)"";
     }
}

}
#endif

static INT32    mGetCPFGasLabel ( void *which, U_INT8 gas         )
{
	mLog("call mGetCPFGasLabel\n");
	return (INT32)"";
	/*
     if(GetCPFDetGasPresence( ((MULT_PTRS * const)which)->position, gas ))
     {
        return (INT32)GetCPFGasLabel ( ((MULT_PTRS * const)which)->position , gas );
     }
     else
     {
            return (INT32)"";
     }
	 */
}

static INT32    mGetOIMCtlLabel ( void *which, U_INT8 channl )
{
	mLog("call mGetOIMCtlLabel\n");
	return (INT32)"";
	/*
     if(GetCPFCtlPresence( ((MULT_PTRS * const)which)->position, channl))
     {
        return (INT32)GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , channl);
     }
     else
     {
        return (INT32)"";
     }
	 */

}

static INT32    mGetOIMCtlBits ( void *which , U_INT8 channl )
{
   return (INT32)GetCPFCtlNumBits(((MULT_PTRS * const)which)->position, channl );
}

static INT32    mGetOIMCtlFormat ( void *which, U_INT8 channl )
{
	mLog("call mGetOIMCtlFormat\n");
	return 0;
  // return (INT32)GetCPFCtlFormat ( ((MULT_PTRS * const)which)->position, channl );
}

static INT32    mGetOEMDetLabel ( void *which, U_INT8 unused_parm )
{
    BIT8  *msg_string;
    DET_TYPE type;

    (void) unused_parm;

    msg_string =  GetCPFDetTitle ( ((MULT_PTRS * const)which)->position ); /* GetCPFDetTitle rtns FDName or BDName */
    if (*msg_string > 1 ) return (INT32) msg_string ;

    type = GetDetectorType(((MULT_PTRS * const)which)->position);
    return (INT32)(2+MessageToString( type==OEM_AIB? MSG_DET_OEM_AIB: MSG_DET_OEM_FID ));
}

static INT32    mGetOEMGasLabel ( void *which, U_INT8 channl )
{
    BIT8  *msg_string;
	mLog("call mGetOEMGasLabel\n");
//     msg_string =  GetCPFGasLabel ( ((MULT_PTRS * const)which)->position , channl);
// 
//     if (*msg_string != 1 ) return (INT32) msg_string ;
    return (INT32)"" ;
}

static INT32    mGetOEMCtlLabel ( void *which, U_INT8 channl )
{
	BIT8  *msg_string;
	mLog("call mGetOEMCtlLabel\n");

//     msg_string =  GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , channl);
// 
//     if (*msg_string != 1 ) return (INT32) msg_string ;
    return (INT32)"" ;
}

static INT32    mGetOEMContrlCfg ( void *which, U_INT8 channl )
{
	BIT8  *msg_string;
	mLog("call mGetOEMContrlCfg\n");
	return 0;
	/*
    msg_string =  GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , channl);

    if (*msg_string == 1 ) return -1 ;

    if (channl > 5 ) return 0 ;

    return (INT32)GetOEMCtlPulseLen  ( ((MULT_PTRS * const)which)->position, channl );
	*/
}

static INT32    mGetOEMPulseLen  ( void *which, U_INT8 channl )
{
   return (INT32)GetOEMCtlPulseLen  ( ((MULT_PTRS * const)which)->position, channl );
}

static INT32    mGetOEMPollTime  ( void *which, U_INT8 unused_parm )
{
   (void) unused_parm;

   return (INT32)OEMPollTym[(((MULT_PTRS * const)which)->position == FRONT ? 0 : 1 )] ;
}

static INT32    mGetOEMDiagParm    ( void *which, U_INT8 indx   )
{
   OEM_DIAG_TYPE     *pDiag;

   switch( 2*(BIT8)(((MULT_PTRS * const)which)->position) + ( indx >> 2) )
   {
      default:
      case 0 :
                pDiag = &FDDiag1 ;
                break ;

      case 1 :
                pDiag = &FDDiag2 ;
                break ;

      case 2 :
                pDiag = &BDDiag1 ;
                break ;

      case 3 :
                pDiag = &BDDiag2 ;
                break ;
   };

   switch (indx % 4 )
   {
      default:
      case 0:
              return (INT32)(pDiag->OldGain );  /* gain for old sample, i.e. filter co-efficient */

      case 1:
              return (INT32)(pDiag->mult   );   /* scaling gain */

      case 2:
              return (INT32)(pDiag->offset  );   /* scaling offset */

      case 3:
              return (INT32)(pDiag->dvdr    );   /* scaling offset */
   }

}

static INT32 mGetOEMOnOffActual(void *which, U_INT8 channl )
{
	mLog("call mGetOEMOnOffActual\n");
	return 0;
      //  return (INT32)GetOEMOnOffActual(((MULT_PTRS * const)which)->position, channl );
}

static INT32    mGetOEMDiagActual ( void *which, U_INT8 channl )
{
	mLog("call mGetOEMDiagActual\n");
	return 0;
   return (INT32)GetOEMDiagValu   ( ((MULT_PTRS * const)which)->position, channl );
}

static INT32    mGetOEMSerialActual  ( void *which,  U_INT8 unused_parm )
{
    (void) unused_parm;

    return (INT32)( ((MULT_PTRS * const)which)->position == FRONT ? FDetSerialIn : BDetSerialIn );
}

static INT32    mGetOEMInstrLabel ( void * which, U_INT8 unused_parm )
{
    (void) unused_parm;
    (void) which ;

        if (GCName[0] < 2) return (INT32)(2+MessageToString(PRODUCT_NO_MSG));
    return (INT32) &GCName[0];
}

#if 0
{

static INT32    mGetOIMCtl1Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFCtlPresence( ((MULT_PTRS * const)which)->position, 1))
     {
        return (INT32)GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , 1);
     }
     else
     {
        return (INT32)"";
     }

}
static INT32    mGetOIMCtl1Bits ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

   return (INT32)GetCPFCtlNumBits(((MULT_PTRS * const)which)->position, 1);
}
static INT32    mGetOIMCtl1Format ( void *which, U_INT8 unused_parm )
{
   (void) unused_parm;

   return (INT32)GetCPFCtlFormat ( ((MULT_PTRS * const)which)->position,1 );
}
static INT32    mGetOIMCtl2Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFCtlPresence( ((MULT_PTRS * const)which)->position, 2))
     {
        return (INT32)GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , 2);
     }
     else
     {
        return (INT32)"";
     }

}
static INT32    mGetOIMCtl2Bits ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

   return (INT32)GetCPFCtlNumBits ( ((MULT_PTRS * const)which)->position,2 );
}
static INT32    mGetOIMCtl2Format ( void *which, U_INT8 unused_parm )
{
   (void) unused_parm;

   return (INT32)GetCPFCtlFormat( ((MULT_PTRS * const)which)->position,2 );
}
static INT32    mGetOIMCtl3Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFCtlPresence( ((MULT_PTRS * const)which)->position, 3))
     {
        return (INT32)GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , 3);
     }
     else
     {
        return (INT32)"";
     }

}
static INT32    mGetOIMCtl3Bits ( void *which, U_INT8 unused_parm )
{
   (void) unused_parm;

   return (INT32)GetCPFCtlNumBits( ((MULT_PTRS * const)which)->position,3 );
}
static INT32    mGetOIMCtl3Format ( void *which, U_INT8 unused_parm )
{
   (void) unused_parm;

   return (INT32)GetCPFCtlFormat( ((MULT_PTRS * const)which)->position,3 );
}
static INT32    mGetOIMCtl4Label ( void *which, U_INT8 unused_parm )
{
     (void) unused_parm;

     if(GetCPFCtlPresence( ((MULT_PTRS * const)which)->position, 4))
     {
        return (INT32)GetCPFCtlLabel ( ((MULT_PTRS * const)which)->position , 4);
     }
     else
     {
        return (INT32)"";
     }

}
static INT32    mGetOIMCtl4Bits( void *which, U_INT8 unused_parm )
{
   (void) unused_parm;

   return (INT32)GetCPFCtlNumBits( ((MULT_PTRS * const)which)->position,4 );
}
static INT32    mGetOIMCtl4Format ( void *which, U_INT8 unused_parm )
{

   (void) unused_parm;

   return (INT32)GetCPFCtlFormat( ((MULT_PTRS * const)which)->position,4 );
}

}
#endif

static UI_ERR   mLetCPFDetTitlePresence( void *status, INT32 setpt, U_INT8 unused_parm )
{
        (void) unused_parm;

     gccw.CPFDetTitlePresence[index_status] = TRUE;
     StrNCpy(gccw.CPFDetTitle[index_status],(BIT8 *)setpt,DET_NAME_SIZE);
     return OK;
}

static UI_ERR   mLetCPFOIMPresence( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;

     /* if this command is in the workfile the OIM board must be present */
     gccw.CPFOIMPresence[index_status] = TRUE;
     return OK;
}

static UI_ERR   mLetCPFDetPneuPresence( void *status, INT32 setpt, U_INT8 unused_parm )
{
     (void) unused_parm;
     (void) setpt;

     /* if this command is in the workfile the CPF pneumatics module must be present */
     gccw.CPFDetPneuPresence[index_status] = TRUE;
     return OK;
}

static UI_ERR   mLetOIMCtlBits ( void *status, INT32 setpt, U_INT8 channl )
{
        gccw.CPFCtlNumBits[index_status][ channl ] = (BIT8)setpt;
        return OK;
}

static void ResetOEMCtlStates ( BIT8 indx     )
{
     BIT8  channl;

     for (channl = 0; channl < DET_NAME_SIZE+1; channl++  )
     {
        gccw.OEMCtlStates[indx][channl] = 0 ; /* need this b/c "|=" below only SETS, does not CLEAR bits */
                                              /* Note that only 1st two cells of F,B arrays are needed  */
     }
}

static UI_ERR   mLetOEMContrlCfg ( void *status, INT32 setpt, U_INT8 channl )          /* WAS  "mLetOEMCtlState" */
{
     U_INT16  activ;

     if (channl == 1) (void)ResetOEMCtlStates(index_status ) ;

     activ = (setpt == -1 )? 0 : 1  ;

     gccw.OEMCtlStates[index_status][(channl-1) >> 3   ] |= ( activ  << ( (channl-1) % 8 ) ) ;
     /* the above line bit-packs the 1st 8 channels into the 1st cell, the 2nd 8 into the 2nd cell, ...  */

     if (channl > 5 )
     {
        if ( ((setpt+1) & 0xfffffffe) == 0 ) return  OK ;

        gccw.OEMCtlStates[index_status][(channl-1) >> 3   ] ^= ( 1 << ( (channl-1) % 8 ) ) ; /* force err */
        return  PARAM_TOO_LARGE ;
     };

     if (activ == 0)
     {
        gccw.OEMCtlPulseLens[index_status][ channl-1 ] =
               (BIT8)(GetOEMCtlPulseLen( ((MULT_PTRS * const)status)->position, channl ));
        return OK ;

     }
     else
     {
        if ( (BIT32)setpt < 256 )
        {
           gccw.OEMCtlPulseLens[index_status][ channl-1 ] = (BIT8)setpt;
           return OK;
        }
        else                                   /* force a cfg error and return reason in CCER */
        {
           gccw.OEMCtlPulseLens[index_status][ channl-1 ] =
                  (BIT8)(~GetOEMCtlPulseLen( ((MULT_PTRS * const)status)->position, channl ));
           return PARAM_TOO_LARGE ;
        }
     }
}

static UI_ERR   mLetOEMGasCfg  ( void *status, INT32 setpt, U_INT8 channl )
{
        if ( ( (BIT32)setpt < 256 ) || ( (BIT32)setpt == 0xffff ) )
        {
           gccw.OEMDetGasModes[index_status][ channl ] = (U_INT16)setpt;
           return OK;
        }
        else                                   /* force a cfg error and return reason in CCER */
        {
           gccw.OEMDetGasModes[index_status][ channl ] = (U_INT16)(~ OEMDetFritFlags[index_status][channl-1] ) ;
           return PARAM_TOO_LARGE ;
        }
}

#if 0
{

static UI_ERR   mLetOIMCtl1Bits ( void *status, INT32 setpt, U_INT8 unused_parm)
{
        (void) unused_parm;

        gccw.CPFCtlNumBits[index_status][1] = (BIT8)setpt;
        return OK;
}

static UI_ERR   mLetOIMCtl2Bits ( void *status, INT32 setpt, U_INT8 unused_parm)
{
        (void) unused_parm;

        gccw.CPFCtlNumBits[index_status][2] = (BIT8)setpt;
        return OK;
}
static UI_ERR   mLetOIMCtl3Bits ( void *status, INT32 setpt, U_INT8 unused_parm)
{
        (void) unused_parm;

        gccw.CPFCtlNumBits[index_status][3] = (BIT8)setpt;
        return OK;
}
static UI_ERR   mLetOIMCtl4Bits ( void *status, INT32 setpt, U_INT8 unused_parm)
{
        (void) unused_parm;

        gccw.CPFCtlNumBits[index_status][4] = (BIT8)setpt;
        return OK;
}

}
#endif
